-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s3: bugfix, use sync.Map instead of map for storing multi part upload… #436
Conversation
Codecov Report
@@ Coverage Diff @@
## main #436 +/- ##
==========================================
+ Coverage 83.71% 83.74% +0.02%
==========================================
Files 49 49
Lines 10158 10174 +16
==========================================
+ Hits 8504 8520 +16
Misses 1294 1294
Partials 360 360
Continue to review full report at Codecov.
|
pkg/storage/s3/storage.go
Outdated
@@ -35,6 +35,24 @@ const ( | |||
RWLOCK = "RWLock" | |||
) | |||
|
|||
type multiPartUploads struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you need this struct at all? Couldn't you have just used a sync.Map directly? It is nice to have the apis, but still.
pkg/storage/s3/storage.go
Outdated
@@ -45,8 +63,8 @@ type ObjectStorage struct { | |||
// We must keep track of multi part uploads to s3, because the lib | |||
// which we are using doesn't cancel multiparts uploads | |||
// see: https://github.com/distribution/distribution/blob/main/registry/storage/driver/s3-aws/s3.go#L545 | |||
isMultiPartUpload map[string]bool | |||
metrics monitoring.MetricServer | |||
multiPartUploads multiPartUploads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be a sync.Map
…s references add storage lock in GetIndexContent Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…s references
add storage lock in GetIndexContent
Signed-off-by: Petu Eusebiu peusebiu@cisco.com
What type of PR is this?
Which issue does this PR fix:
What does this PR do / Why do we need it:
If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
Testing done on this change:
Automation added to e2e:
Will this break upgrades or downgrades. Has updating a running cluster been tested?:
Does this change require updates to the CNI daemonset config files to work?:
Does this PR introduce any user-facing change?:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.