-
Notifications
You must be signed in to change notification settings - Fork 807
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
Refactor inFlight key to add lock per volumeId #702
Refactor inFlight key to add lock per volumeId #702
Conversation
Hi @AndyXiangLi. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
Pull Request Test Coverage Report for Build 1612
💛 - Coveralls |
0a50dd2
to
5da84f0
Compare
pkg/driver/internal/inflight.go
Outdated
@@ -45,26 +46,25 @@ func NewInFlight() *InFlight { | |||
|
|||
// Insert inserts the entry to the current list of inflight requests. |
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.
Can we update the comment here?
pkg/driver/internal/inflight.go
Outdated
db.mux.Lock() | ||
defer db.mux.Unlock() | ||
|
||
delete(db.inFlight, h.String()) | ||
delete(db.inFlight, volumeId) |
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.
so h.String()
is always equal to volumeId
?
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.
No, previously the key in this cache is the hash of entire request( including volumeId and other fields like targetPath) so the driver has chance to process multiple requests for one volume at same time (Like same volumeId with different targetPath), which should not happen per spec
That's why I changed the key to volumeId.
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.
I guess my question is will the delete
function work properly with the volumeId
instead?
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.
Oh nvm I'm dumb heh.
Mostly LGTM, but ideally we should have @gnufied take a look as well since he opened one of the issues. |
5da84f0
to
22b25f6
Compare
/test pull-aws-ebs-csi-driver-e2e-external-test |
@AndyXiangLi: The specified target(s) for
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test pull-aws-ebs-csi-driver-external-test-latest |
/test pull-aws-ebs-csi-driver-e2e-single-az |
/test pull-aws-ebs-csi-driver-e2e-multi-az |
/test pull-aws-ebs-csi-driver-e2e-single-az |
22b25f6
to
c4c854d
Compare
c4c854d
to
cb3f336
Compare
cb3f336
to
8155fe8
Compare
@gnufied How's this looks to you and can we merge this change? |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AndyXiangLi, ayberk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is this a bug fix or adding new feature?
Fixes #307
Fixes #370
What is this PR about? / Why do we need it?
Handle concurrency for node operations (stage/unstage publish/unpublish)
According to https://github.com/container-storage-interface/spec/blob/master/spec.md#concurrency driver's InFlight cache should track in-flight request per volumeId instead of per request to ensure no more than one request per volume at a given time.