Repository navigation
ftp: fix deadlock after failed update when concurrency=1 - #5590
Merged
Merged
Conversation
Member
Author
|
Manual unit test: |
Member
Author
|
@ncw Please look |
This was referenced Sep 11, 2021
Member
Author
|
@ncw |
ivandeex
force-pushed
the
pr-ftp-deadlock
branch
from
September 30, 2021 06:36
c289eb3 to
4fc7bcb
Compare
ncw
approved these changes
Sep 30, 2021
ncw
left a comment
Member
There was a problem hiding this comment.
That looks sensible - let's merge :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this change?
Our users complained many times that rclone FTP client manifests random problems with completing a file upload.
As my investigations have shown, the bug triggers because jlaffaye/ftp does not properly nudge the fshttp anti-hanging timer on command channel after a file upload. I have a working fix for jlaffaye/ftp and backend/ftp which I will submit later.
This pull request solves a second-stage bug triggered by the above bug which can be fixed solely in rclone. Frequently when users reported the above bug we recommended them to simplify their FTP client settings, in particular set
--ftp-concurrency=1. When the FTP backend's upload routine encounters a error, it will remove the failed file. The removal needs another connection but due to low concurrency setting it will wait for connection token forever.This patch modifies the upload routine so that after error it will first release the failed connection and then remove the failed file and thus avoid the deadlock.
Due to presence of another bug I will include a relevant unit test with a dedicated pull request #5596, not here. I just hope that the change looks self-evident. @ncw ??
Was the change discussed in an issue or in the forum before?
Checklist