Skip to content

fix(doctor): run TUI on blocking thread to prevent single-worker starvation#697

Open
rohan-bes wants to merge 1 commit into
mainfrom
fix/doctor-tui-blocking-starvation
Open

fix(doctor): run TUI on blocking thread to prevent single-worker starvation#697
rohan-bes wants to merge 1 commit into
mainfrom
fix/doctor-tui-blocking-starvation

Conversation

@rohan-bes

Copy link
Copy Markdown
Contributor

Summary

  • run_tui's loop has no .await points (terminal I/O and crossterm::event::poll are plain blocking calls), so scheduling it with tokio::spawn starves every other task on a single-worker-thread runtime — the default on single-vCPU hosts — including the sweep it's meant to display, reading as a permanent hang.
  • Switch to tokio::task::spawn_blocking, whose dedicated thread pool never contends with the async worker pool.

Test plan

  • Run doctor on a single-vCPU host and confirm the TUI no longer hangs

…vation

run_tui's loop has no .await points, so scheduling it with tokio::spawn
on a single-worker-thread runtime (the default on single-vCPU hosts)
starves every other task, including the sweep it's meant to display,
for as long as it runs. Move it to spawn_blocking's dedicated pool
instead.

Co-authored-by: Claude <noreply@anthropic.com>
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