-
Notifications
You must be signed in to change notification settings - Fork 10.2k
concurrency: add timeout for LeaseGrant in NewSession #20994
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: qts0312 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @qts0312. Thanks for your PR. I'm waiting for a github.com 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-sigs/prow repository. |
|
Please sign DCO |
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.
There is already tests/integration/clientv3/concurrency/session_test.go that has only 100 lines, don't think we need a separate file for timeout.
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 have simplified the tests and moved them to session_test.go
95fd1c1 to
2c01014
Compare
Signed-off-by: qts0312 <[email protected]>
2c01014 to
7b5df49
Compare
Signed-off-by: qts0312 <[email protected]>
4436dbf to
1db0837
Compare
This PR follows concurrency: add timeout for LeaseGrant in NewSession #20022 as the original PR has no updates and been closed now. The credit should belong to @Antraxmin.
What this PR does
This PR adds a timeout to the
LeaseGrantRPC call in theNewSessionfunction to prevent infinite blocking.Why this change is needed
Currently,
LeaseGrantinNewSessionis called without a deadline, which can cause the function to block indefinitely if the RPC call hangs. This is inconsistent with theClose()method, which properly usescontext.WithTimeoutfor theLeaseRevokecall.Changes made
NewSessionfunction inclient/v3/concurrency/session.goto usecontext.WithTimeoutforLeaseGrantcalldefaultLeaseTimeoutsecondsTesting