[arvados] created: 2.6.0-393-gf297b02e1
git repository hosting
git at public.arvados.org
Thu Jul 20 15:28:20 UTC 2023
at f297b02e149a06af42b0eaa8745b57dfea58b9e3 (commit)
commit f297b02e149a06af42b0eaa8745b57dfea58b9e3
Author: Tom Clegg <tom at curii.com>
Date: Thu Jul 20 11:26:51 2023 -0400
20726: Fix unreleased session in s3 handler.
Caused subsequent requests with the same token to hang after reaching
expiry time.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/keep-web/s3.go b/services/keep-web/s3.go
index 8615ceaf0..3e60f3006 100644
--- a/services/keep-web/s3.go
+++ b/services/keep-web/s3.go
@@ -335,6 +335,7 @@ func (h *handler) serveS3(w http.ResponseWriter, r *http.Request) bool {
s3ErrorResponse(w, InternalError, err.Error(), r.URL.Path, http.StatusInternalServerError)
return true
}
+ defer sess.Release()
readfs := fs
if writeMethod[r.Method] {
// Create a FileSystem for this request, to avoid
diff --git a/services/keep-web/s3_test.go b/services/keep-web/s3_test.go
index 9f8650b8e..0e821696b 100644
--- a/services/keep-web/s3_test.go
+++ b/services/keep-web/s3_test.go
@@ -325,6 +325,11 @@ func (s *IntegrationSuite) TestS3ProjectPutObjectSuccess(c *check.C) {
s.testS3PutObjectSuccess(c, stage.projbucket, stage.coll.Name+"/", stage.coll.UUID)
}
func (s *IntegrationSuite) testS3PutObjectSuccess(c *check.C, bucket *s3.Bucket, prefix string, collUUID string) {
+ // We insert a delay between test cases to ensure we exercise
+ // rollover of expired sessions.
+ sleep := time.Second / 100
+ s.handler.Cluster.Collections.WebDAVCache.TTL = arvados.Duration(sleep * 3)
+
for _, trial := range []struct {
path string
size int
@@ -360,6 +365,7 @@ func (s *IntegrationSuite) testS3PutObjectSuccess(c *check.C, bucket *s3.Bucket,
contentType: "application/x-directory",
},
} {
+ time.Sleep(sleep)
c.Logf("=== %v", trial)
objname := prefix + trial.path
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list