mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 00:43:49 +01:00
ftp: fix lockup on Close failures when using concurrency limit #3984
Before this change if rclone failed to close a file download for some reason it would leak a concurrency token. When all the tokens were leaked then rclone would lock up. This fix returns the concurrency token regardless of the error status.
This commit is contained in:
parent
e8eb658ba5
commit
da5cbc194a
@ -788,11 +788,13 @@ func (f *ftpReadCloser) Close() error {
|
||||
case <-timer.C:
|
||||
// if timer fired assume no error but connection dead
|
||||
fs.Errorf(f.f, "Timeout when waiting for connection Close")
|
||||
f.f.putFtpConnection(nil, nil)
|
||||
return nil
|
||||
}
|
||||
// if errors while reading or closing, dump the connection
|
||||
if err != nil || f.err != nil {
|
||||
_ = f.c.Quit()
|
||||
f.f.putFtpConnection(nil, nil)
|
||||
} else {
|
||||
f.f.putFtpConnection(&f.c, nil)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user