Repository navigation
fix: take the write lock in status.Render - #2290
Merged
TerryHowe merged 1 commit intoOct 24, 2026
Merged
Conversation
Render advances the spinner and the speed window, so concurrent renders from the ticker and from Track raced under the read lock. Signed-off-by: Wleeaf <[email protected]>
wleeaf
requested review from
TerryHowe,
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
October 24, 2026 06:45
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2290 +/- ##
=======================================
Coverage 60.78% 60.78%
=======================================
Files 140 140
Lines 6092 6092
=======================================
Hits 3703 3703
Misses 2167 2167
Partials 222 222 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
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.
What this PR does / why we need it:
status.Renderadvances the spinner and adds a point to the speed window, but it only helds.lock.RLock().manager.render()runs from both the ticker goroutine andTrack, so two renders of the same status could run at once and race onstatus.markand thespeedWindowfields.Rendernow takes the write lock, like theupdate*functions that also modify the status.Test:
Test_status_Render_concurrentrenders one in-progress status from 8 goroutines. Withgo test -race, it fails on main (WARNING: DATA RACEinspinner.symbol/speedWindow.Add) and passes with this change. The concurrent-Trackreproduction from the issue showed races in 16 of 20 runs before the change and 0 of 20 after.make testandgolangci-lint runpass.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #2289
Please check the following list: