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

*: fix data race in the ReuseChunkPool #46283

Closed
wants to merge 1 commit into from

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Aug 21, 2023

What problem does this PR solve?

Issue Number: close #46282

Problem Summary:

What is changed and how it works?

Check List

Tests

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

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.

None

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei hawkingrei requested a review from a team as a code owner August 21, 2023 08:56
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue labels Aug 21, 2023
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #46283 (771e042) into master (94cfa8b) will decrease coverage by 0.6692%.
Report is 1 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46283        +/-   ##
================================================
- Coverage   73.3694%   72.7002%   -0.6692%     
================================================
  Files          1285       1306        +21     
  Lines        394832     401026      +6194     
================================================
+ Hits         289686     291547      +1861     
- Misses        86684      90957      +4273     
- Partials      18462      18522        +60     
Flag Coverage Δ
integration 25.5638% <100.0000%> (?)
unit 73.3809% <100.0000%> (+0.0115%) ⬆️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0667% <ø> (ø)
br 47.8811% <ø> (-4.3469%) ⬇️

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 21, 2023

@cfzjywxk: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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.

@hawkingrei hawkingrei requested a review from tiancaiamao August 21, 2023 10:12
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 21, 2023

@qw4990: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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.

@tiancaiamao
Copy link
Contributor

From the calling stack, you can infer that the same session is used by different goroutine, that's the root cause of the data race.
So a real fix should fix the test case to avoid that misusage, rather than add a mutex blindly.

@easonn7
Copy link

easonn7 commented Aug 21, 2023

/approve

there is no variable change in this PR, LGTM

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, easonn7, qw4990

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 the approved label Aug 21, 2023
@tiancaiamao
Copy link
Contributor

ingest.LitBackCtxMgr = ingest.NewMockBackendCtxMgr(func() sessionctx.Context {
tk.MustExec("rollback;")
tk.MustExec("begin;")
return tk.Session()
})

Return this session for several goroutines to use is unsafe.

@tiancaiamao
Copy link
Contributor

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2023
@hawkingrei
Copy link
Member Author

/hold

@hawkingrei hawkingrei closed this Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. 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.

DATA RACE in the ReuseChunkPool
5 participants