mirror of
https://github.com/rclone/rclone.git
synced 2025-01-13 20:38:12 +02:00
qingstor: fix go routine leak on multipart upload errors - fixes #2851
This commit is contained in:
parent
39f5059d48
commit
9685be64cd
@ -392,6 +392,14 @@ func (mu *multiUploader) multiPartUpload(firstBuf io.ReadSeeker) error {
|
||||
var nextChunkLen int
|
||||
reader, nextChunkLen, err = mu.nextReader()
|
||||
if err != nil && err != io.EOF {
|
||||
// empty ch
|
||||
go func() {
|
||||
for range ch {
|
||||
}
|
||||
}()
|
||||
// Wait for all goroutines finish
|
||||
close(ch)
|
||||
mu.wg.Wait()
|
||||
return err
|
||||
}
|
||||
if nextChunkLen == 0 && partNumber > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user