Commit Graph
5 Commits
Author SHA1 Message Date
Daniel HiltgenandGitHub 43983edf18 progress: fix data races on ticker, states, spinner, and bar state (#17445)
* progress: fix data races on ticker, states, spinner, and bar state

NewProgress spawned start() which wrote p.ticker while stop() read and
cleared it with no synchronization; stop() and StopAndClear() also read
p.states and p.pos outside p.mu, Spinner's start() goroutine raced
Stop() and String() on s.value/s.stopped/s.ticker, and Bar.Set raced
Bar.String on currentValue/stopped/buckets (callback goroutine vs the
render goroutine). Detected by go test -race across cmd and cmd/launch
(~20 warnings; the Bar race is latent — never flagged because tests
don't interleave it, but real in production pull/push progress).

Create tickers before spawning the render goroutines and pass the
channel in, guard Progress internals with p.mu throughout stop() (via a
renderLocked core), and give Spinner and Bar their own mutexes.

* use a more idiomatic channel based done signal
2026-08-04 15:06:15 -07:00
JoshandGitHub f7e3b9190f cmd: spinner progress for transfer model data (#6100) 2024-08-12 11:46:32 -07:00
Michael Yang 424d53ac70 progress: fix bar rate 2023-11-28 11:44:56 -08:00
Jeffrey Morgan c06b9b7304 update progress rendering to be closer to v0.1.10 2023-11-19 13:43:21 -05:00
Michael Yang c4a3ccd7ac progress 2023-11-17 10:06:19 -08:00