mirror of
https://github.com/rclone/rclone.git
synced 2024-11-08 01:25:14 +01:00
ftp: fix lockup when using concurrency limit on failed connections #3984
Before this change if rclone failed to make an FTP connection for some reason it would leak a concurrency token. When all the tokens were leaked then rclone would lock up. The fix returns the concurrency token if creating the FTP connection returns an error.
This commit is contained in:
parent
07e4b9bb7f
commit
28f69f25a0
@ -190,7 +190,11 @@ func (f *Fs) getFtpConnection() (c *ftp.ServerConn, err error) {
|
||||
if c != nil {
|
||||
return c, nil
|
||||
}
|
||||
return f.ftpConnection()
|
||||
c, err = f.ftpConnection()
|
||||
if err != nil && f.opt.Concurrency > 0 {
|
||||
f.tokens.Put()
|
||||
}
|
||||
return c, err
|
||||
}
|
||||
|
||||
// Return an FTP connection to the pool
|
||||
|
Loading…
Reference in New Issue
Block a user