-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
CI: Address data race in TestSchemaVersioning #15998
Merged
rohit-nayak-ps
merged 1 commit into
vitessio:main
from
planetscale:datarace_TestSchemaVersioning
May 23, 2024
Merged
CI: Address data race in TestSchemaVersioning #15998
rohit-nayak-ps
merged 1 commit into
vitessio:main
from
planetscale:datarace_TestSchemaVersioning
May 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This resulted from the fact that the same ctx variable/pointer is re-used in the test and because we did not wait for the goroutine to end once the previous context was cancelled before we overwrote the variable/pointer with a new context those two goroutines were racing on reads and writes of the address. Signed-off-by: Matt Lord <[email protected]>
mattlord
requested review from
harshit-gangal,
rohit-nayak-ps and
systay
as code owners
May 23, 2024 02:17
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
vitess-bot
bot
added
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
NeedsWebsiteDocsUpdate
What it says
labels
May 23, 2024
mattlord
removed
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsWebsiteDocsUpdate
What it says
NeedsIssue
A linked issue is missing for this Pull Request
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
labels
May 23, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15998 +/- ##
=======================================
Coverage 68.24% 68.24%
=======================================
Files 1562 1562
Lines 197171 197173 +2
=======================================
+ Hits 134550 134552 +2
Misses 62621 62621 ☔ View full report in Codecov by Sentry. |
rohit-nayak-ps
approved these changes
May 23, 2024
deepthi
approved these changes
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This data race resulted from the fact that the same ctx variable/pointer is re-used in the test and because we did not wait for the goroutine to end once the previous context was cancelled before we overwrote the variable/pointer with a new context those two goroutines were racing on reads and writes of the address. So the race looked like this:
With those two access being:
vitess/go/vt/vttablet/endtoend/vstreamer_test.go
Lines 151 to 156 in 0d8ca1b
vitess/go/vt/vttablet/endtoend/vstreamer_test.go
Lines 187 to 191 in 0d8ca1b
This PR adds a
WaitGroup
to ensure that we wait for the goroutine from the previous test case — which is polling the context's done channel — to end before we overwrite the ctx variable/pointer for the next test case.Related Issue(s)
Checklist