internal/client: close stream on first recv error - #2023
Conversation
|
Hi @windtalker. Thanks for your PR. I'm waiting for a tikv 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. DetailsInstructions 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughFirst-receive non-EOF errors now close coprocessor, batch coprocessor, and MPP streams. Tests simulate these failures and verify that the associated stream contexts are canceled. ChangesStream lease cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
a5548a3 to
2a79cc3
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekexium, zyguan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue Number: close #2018
Problem Summary:
Stream RPC leases can be retained indefinitely in
tikvrpc.CheckStreamTimeoutLoopif a stream is registered intoconnArray.streamTimeoutand the setup path returns after the firstRecvreports a non-EOF error without closing the stream.Recvresets the lease deadline to0before returning, and the timeout loop treatsdeadline == 0as active/idle, so the stale lease can remain tracked indefinitely.What is changed:
Recvreturns a non-EOF error.Recvreturns a non-EOF error.Recvreturns a non-EOF error.TestStreamFirstRecvErrorClosesLeaseto cover all three stream setup paths and verify the stream context is canceled.Tests:
go test ./internal/client -run '^TestStreamFirstRecvErrorClosesLease$'Summary by CodeRabbit