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

util: Resolve RuntimeStatsColl potential unlock mutex #55118

Merged
merged 1 commit into from
Aug 1, 2024
Merged

util: Resolve RuntimeStatsColl potential unlock mutex #55118

merged 1 commit into from
Aug 1, 2024

Conversation

yibin87
Copy link
Contributor

@yibin87 yibin87 commented Aug 1, 2024

What problem does this PR solve?

Issue Number: close #55042

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.
      Just a mutex lock changes, using defer to protect it.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the issue that queries may get stuck when they are being killed due to exceeding tidb_mem_quota_query.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 1, 2024
Copy link

tiprow bot commented Aug 1, 2024

Hi @yibin87. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

@yibin87
Copy link
Contributor Author

yibin87 commented Aug 1, 2024

/cc @wshwsh12 @guo-shaoge

@ti-chi-bot ti-chi-bot bot requested review from guo-shaoge and wshwsh12 August 1, 2024 05:05
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.8757%. Comparing base (68b529e) to head (f999c64).
Report is 196 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55118        +/-   ##
================================================
+ Coverage   72.7939%   74.8757%   +2.0818%     
================================================
  Files          1562       1566         +4     
  Lines        439174     440961      +1787     
================================================
+ Hits         319692     330173     +10481     
+ Misses        99754      90673      -9081     
- Partials      19728      20115       +387     
Flag Coverage Δ
integration 49.8786% <100.0000%> (?)
unit 71.8612% <100.0000%> (+0.0746%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 52.5555% <ø> (+6.6789%) ⬆️

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 1, 2024
@@ -1301,6 +1301,7 @@ func NewRuntimeStatsColl(reuse *RuntimeStatsColl) *RuntimeStatsColl {
// RegisterStats register execStat for a executor.
func (e *RuntimeStatsColl) RegisterStats(planID int, info RuntimeStats) {
Copy link
Member

Choose a reason for hiding this comment

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

replace sync.Metux with syncutil.Mutex which can find the potential mutex in the CI.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 1, 2024
Copy link

ti-chi-bot bot commented Aug 1, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-01 05:35:59.02657947 +0000 UTC m=+420475.306627537: ☑️ agreed by hawkingrei.
  • 2024-08-01 06:28:42.776163711 +0000 UTC m=+423639.056211780: ☑️ agreed by wshwsh12.

@yibin87
Copy link
Contributor Author

yibin87 commented Aug 1, 2024

/test unit-test

Copy link

tiprow bot commented Aug 1, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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.

Copy link

ti-chi-bot bot commented Aug 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guo-shaoge, hawkingrei, wshwsh12

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:
  • OWNERS [guo-shaoge,hawkingrei,wshwsh12]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yibin87
Copy link
Contributor Author

yibin87 commented Aug 1, 2024

/retest

Copy link

tiprow bot commented Aug 1, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot merged commit b0aced8 into pingcap:master Aug 1, 2024
23 checks passed
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. and removed needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels Aug 2, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. labels Aug 26, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. label Aug 26, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query stuck when trying to kill it because of OOM
5 participants