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

client/controller: record context error and add slowlog about token bucket #8344

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Jun 27, 2024

What problem does this PR solve?

Issue Number: Close #8343

What is changed and how does it work?

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Release note

None.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 27, 2024
@nolouch nolouch force-pushed the fix-missing-error branch 3 times, most recently from 5109730 to 9482860 Compare July 2, 2024 03:42
…ucket request

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
@@ -218,7 +224,8 @@ func (lim *Limiter) Reserve(ctx context.Context, waitDuration time.Duration, now
select {
case <-ctx.Done():
return &Reservation{
ok: false,
ok: false,
err: ctx.Err(),
Copy link
Member

@HuSharp HuSharp Jul 2, 2024

Choose a reason for hiding this comment

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

Can we use err instead of ok? That would add ErrClientResourceGroupThrottled to err.

Copy link
Contributor Author

@nolouch nolouch Jul 2, 2024

Choose a reason for hiding this comment

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

ok is only used for can if reserved enough tokens, but the error may include others like ctx.Error().

let's keep min changes in this PR first, I don't want to bring potential risks to other branches by picking.

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 2, 2024
Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
Copy link
Contributor

ti-chi-bot bot commented Jul 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HuSharp, JmPotato

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 added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 2, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 2, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-02 08:34:47.479373617 +0000 UTC m=+1313413.964862441: ☑️ agreed by HuSharp.
  • 2024-07-02 09:14:32.10849359 +0000 UTC m=+1315798.593982421: ☑️ agreed by JmPotato.

Copy link
Contributor

ti-chi-bot bot commented Jul 2, 2024

@nolouch: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-integration-realcluster-test 136fc44 link false /test pull-integration-realcluster-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 49f9b11 into tikv:master Jul 2, 2024
16 of 17 checks passed
@nolouch nolouch deleted the fix-missing-error branch July 2, 2024 09:54
@nolouch nolouch added needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels Jul 2, 2024
@nolouch
Copy link
Contributor Author

nolouch commented Jul 2, 2024

/run-cherry-picker

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jul 2, 2024
close tikv#8343

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #8354.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #8355.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jul 2, 2024
close tikv#8343

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jul 2, 2024
close tikv#8343

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #8356.

ti-chi-bot bot pushed a commit that referenced this pull request Jul 4, 2024
…ucket (#8344) (#8355)

close #8343, ref #8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>

Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
ti-chi-bot bot pushed a commit that referenced this pull request Jul 4, 2024
…ucket (#8344) (#8356)

close #8343, ref #8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>

Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
@nolouch
Copy link
Contributor Author

nolouch commented Jul 4, 2024

/run-cherry-picker

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.2: #8363.

ti-chi-bot bot pushed a commit that referenced this pull request Jul 4, 2024
…ucket (#8344) (#8354)

close #8343, ref #8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>

Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
nolouch pushed a commit that referenced this pull request Jul 4, 2024
…ucket (#8344) (#8363)

* client/controller: record context error and add slowlog about token bucket request

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
nolouch added a commit to nolouch/pd that referenced this pull request Jul 4, 2024
…ucket (tikv#8344) (tikv#8355)

close tikv#8343, ref tikv#8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>

Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
nolouch pushed a commit to nolouch/pd that referenced this pull request Jul 4, 2024
…ucket (tikv#8344) (tikv#8355)

close tikv#8343, ref tikv#8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
nolouch pushed a commit to nolouch/pd that referenced this pull request Jul 4, 2024
…ucket (tikv#8344) (tikv#8355)

close tikv#8343, ref tikv#8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
nolouch added a commit that referenced this pull request Jul 4, 2024
…he local bucket (#8352)  (#8365)

* client/controller: record context error and add slowlog about token bucket (#8344) (#8355)

close #8343, ref #8349

client/controller: record context error and add slowlog about token bucket
- record low process start time, and log it if it's too slow
- record the context error

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>

* This is an automated cherry-pick of #8352

close #8349

Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>

---------

Signed-off-by: Shuning Chen <nolouch@ShuningdeMacBook-Pro.local>
Signed-off-by: nolouch <nolouch@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 affects-7.5 affects-8.1 approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.2 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interfering logs in resource controller
4 participants