forked from TrueCloudLab/rclone
ftp: fix deadlock after failed update when concurrency=1
This commit is contained in:
parent
bb0c4ad2d8
commit
69f4b48719
1 changed files with 2 additions and 1 deletions
|
@ -1062,8 +1062,9 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.Quit() // toss this connection to avoid sync errors
|
_ = c.Quit() // toss this connection to avoid sync errors
|
||||||
remove()
|
// recycle connection in advance to let remove() find free token
|
||||||
o.fs.putFtpConnection(nil, err)
|
o.fs.putFtpConnection(nil, err)
|
||||||
|
remove()
|
||||||
return errors.Wrap(err, "update stor")
|
return errors.Wrap(err, "update stor")
|
||||||
}
|
}
|
||||||
o.fs.putFtpConnection(&c, nil)
|
o.fs.putFtpConnection(&c, nil)
|
||||||
|
|
Loading…
Add table
Reference in a new issue