New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlock on MySQL-database when 4-5 simultaneous logins to ProFTPd with updatecount query causing authentication timeout #1663
Comments
Interesting! From reading MySQL docs, I think this is occurring because of the "searched SQL UPDATE", i.e.:
In this
Such "searched UPDATE" statements can cause implicit locking, to ensure an atomic transaction of that read-then-write sequence. I'm not sure how important that Alternatively, from reading https://dev.mysql.com/doc/refman/8.0/en/update.html, you might try this (but I've not tested this yet):
Per the above docs, the
|
In addition to the above, I should also have I wonder if Postgres and SQLite have similar considerations; I'll have to research this topic for them as well. |
For my reference, This current behavior -- lacking retrying on deadlock/busy errors -- looks to be specific just to |
…ments when it detects a server-side deadlock, at least a few times.
Could you try out #1668, see if it helps remedy this issue for you? |
@maltris Would it be possible to see the rest of your ProFTPD configuration, to aid me in reproducing this behavior locally? Thanks! |
Helloo, it was so silent around that topic because I just excluded the update statements in a production environment. But I want to help fixing the problem, so as soon as possible I will try the change you mentioned and report back as soon as I am able. |
…ments when it detects a server-side deadlock, at least a few times.
…ments when it detects a server-side deadlock, at least a few times.
What I Did
Set up ProFTPd with mod_sql and an update-query to the database after FTP PASS. Run 4-5 parallel client logins on the same user against ProFTPd that PASS within the same second (0-1ms from each other). Get this in the sql log:
And a timed out authentication.
What I Expected/Wanted
Get the count of logins and the date of the last login into the database table and run 4-5 simultaneous logins with the same user (in the same second, a few milliseconds from each other) against the ProFTPd.
Example as referenced here:
ProFTPD Version and Configuration
The text was updated successfully, but these errors were encountered: