Skip to content

feat(plugin:dashboard): redraw the screen at least once a second - #755

Merged
markuslf merged 1 commit into
mainfrom
feat/dashboard-ticker
Nov 16, 2026
Merged

markuslf merged 1 commit into
mainfrom
feat/dashboard-ticker

Conversation

@markuslf

Copy link
Copy Markdown
Member

The dashboard screen was only redrawn on events (task start, host results), so the elapsed time and the ETA stood still during a long task. A daemon thread now redraws it when no event did so for a second.

The screen is written with os.write() straight to the file descriptor: Ansible forks its workers while the thread may be drawing, and a fork while the thread holds the lock of the sys.stdout buffer would leave the worker hanging when it flushes its streams at exit (Modules/_io/bufferedio.c does not reset that lock after a fork).

Tested with ansible-core 2.16, 2.18 and 2.22 (unit tests, including a 3-second task during which the clock has to move on), and stress-tested with a 10 ms redraw interval, 30 hosts, 40 tasks and 10 forks.

🤖 Generated with Claude Code

The screen was only redrawn on events, so the elapsed time and the ETA stood
still during a long task. A daemon thread now redraws it when no event did so
for a second.

The screen is written with os.write() straight to the file descriptor instead
of through sys.stdout: Ansible forks its workers while the thread may be
drawing, Modules/_io/bufferedio.c does not reset the buffer lock after a fork,
and multiprocessing flushes the std streams at the end of each worker, which
would hang on a lock held at fork time. Stress-tested with a 10 ms interval,
30 hosts, 40 tasks and 10 forks on ansible-core 2.16 and 2.18.
@markuslf
markuslf merged commit 9c1f23b into main Nov 16, 2026
15 checks passed
@markuslf
markuslf deleted the feat/dashboard-ticker branch November 16, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant