ollama/progress
Daniel Hiltgen 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
..
bar.go progress: fix data races on ticker, states, spinner, and bar state (#17445) 2026-08-04 15:06:15 -07:00
progress.go progress: fix data races on ticker, states, spinner, and bar state (#17445) 2026-08-04 15:06:15 -07:00
progress_test.go progress: fix data races on ticker, states, spinner, and bar state (#17445) 2026-08-04 15:06:15 -07:00
spinner.go progress: fix data races on ticker, states, spinner, and bar state (#17445) 2026-08-04 15:06:15 -07:00
stepbar.go imagegen: remove MLX image generation code (#16615) 2026-07-28 15:35:28 -07:00