[ARVADOS] created: 1.1.4-334-g7e9b9d4
Git user
git at public.curoverse.com
Thu May 31 13:45:38 EDT 2018
at 7e9b9d420b58c22c41a713b9bfbfd0f5718abb1a (commit)
commit 7e9b9d420b58c22c41a713b9bfbfd0f5718abb1a
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Thu May 31 13:44:18 2018 -0400
13517: Fix leaked goroutine and buffer on failed S3 write.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/services/keepstore/s3_volume.go b/services/keepstore/s3_volume.go
index 9d4d801..bdab589 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)
}
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list