You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
manager.render() in cmd/oras/internal/display/status/progress/manager.go can run concurrently with itself. It is called from two places:
the ticker goroutine started in manager.start() (every bufFlushDuration, plus a final render on renderDone)
Track, on the caller's goroutine, before a new status is appended
Both hold only m.lock.RLock(), so nothing stops two renders from overlapping. Copy, push and pull track blobs concurrently, so this happens in normal use.
#2290 fixes the data race on the status itself (Render now takes the status write lock). The console output is still unserialized, though. Each console.OutputTo / NewRow call is several separate writes to the terminal:
When two renders overlap, their cursor restore / move-up / erase sequences interleave. A line can be written at the wrong offset or erased by the other render, which garbles the progress display. The reproduction test in #2289 had to wrap the mock console in a mutex for the same reason.
Proposed fix
Serialize rendering in the manager, for example with a dedicated renderLock sync.Mutex held for the whole of render(), or by doing all rendering from the ticker goroutine and having Track request a render instead of performing one. Once every frame is drawn by one goroutine at a time, the console needs no locking of its own.
A regression test could drive concurrent Track calls against a console that fails the test if OutputTo / NewRow calls overlap.
I can take this. I plan to add a focused concurrent-render regression that holds one console frame open and checks a second render cannot enter it, then serialize manager.render without changing status/console behavior. I will run the progress package race tests and broader display/status tests before a PR.
Activity
kocaemre commentedon Oct 24, 2026
I can take this. I plan to add a focused concurrent-render regression that holds one console frame open and checks a second render cannot enter it, then serialize manager.render without changing status/console behavior. I will run the progress package race tests and broader display/status tests before a PR.