Skip to content
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

locate: fix TestTiKVClientReadTimeout #1601

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

zyguan
Copy link
Contributor

@zyguan zyguan commented Feb 28, 2025

Signed-off-by: zyguan <zhongyangguan@gmail.com>
@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 28, 2025
@zyguan
Copy link
Contributor Author

zyguan commented Feb 28, 2025

PTAL @cfzjywxk @you06

s.vars.sendTimes++

if s.vars.err != nil {
// Because in rpc logic, context.Cancel() will be transferred to rpcContext.Cancel error. For rpcContext cancel,
// we need to retry the request. But for context cancel active, for example, limitExec gets the required rows,
// we shouldn't retry the request, it will go to backoff and hang in retry logic.
if sendCtx.Err() != nil && errors.Cause(sendCtx.Err()) == context.Canceled {
metrics.TiKVRPCErrorCounter.WithLabelValues("context-canceled", storeIDLabel(s.vars.rpcCtx)).Inc()
if canceled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the logic equivalent checking sendCtx here? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, sendCtx must be canceled after send when using RPCCanceller here. It's a mistake made by me in #1565 .

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 28, 2025
@ti-chi-bot ti-chi-bot bot added the lgtm label Mar 4, 2025
Copy link

ti-chi-bot bot commented Mar 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, ekexium

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 4, 2025
Copy link

ti-chi-bot bot commented Mar 4, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-28 08:07:49.9163033 +0000 UTC m=+602417.869461560: ☑️ agreed by cfzjywxk.
  • 2025-03-04 06:11:56.958055327 +0000 UTC m=+335630.086975075: ☑️ agreed by ekexium.

@ti-chi-bot ti-chi-bot bot merged commit 3a625aa into tikv:master Mar 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants