X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a8d73de4f59cf567a96f2f04be01a249d4f7c20b..41e15e626cc301d867c48ebb1f945bbec6b7d555:/services/keepstore/s3_volume.go diff --git a/services/keepstore/s3_volume.go b/services/keepstore/s3_volume.go index 9d4d801928..bdab58927b 100644 --- a/services/keepstore/s3_volume.go +++ b/services/keepstore/s3_volume.go @@ -429,7 +429,7 @@ func (v *S3Volume) Put(ctx context.Context, loc string, block []byte) error { case <-ctx.Done(): theConfig.debugLogf("%s: taking PutReader's input away: %s", v, ctx.Err()) // Our pipe might be stuck in Write(), waiting for - // io.Copy() to read. If so, un-stick it. This means + // PutReader() to read. If so, un-stick it. This means // PutReader will get corrupt data, but that's OK: the // size and MD5 won't match, so the write will fail. go io.Copy(ioutil.Discard, bufr) @@ -438,6 +438,8 @@ func (v *S3Volume) Put(ctx context.Context, loc string, block []byte) error { theConfig.debugLogf("%s: abandoning PutReader goroutine", v) return ctx.Err() case <-ready: + // Unblock pipe in case PutReader did not consume it. + io.Copy(ioutil.Discard, bufr) return v.translateError(err) } }