Skip to content

cli: daemon-thread the TermDisplay poller - #5331

Merged
kitbellew merged 1 commit into
scalameta:mainfrom
kitbellew:termdisplay-daemon
Jul 12, 2026
Merged

kitbellew merged 1 commit into
scalameta:mainfrom
kitbellew:termdisplay-daemon

Conversation

@kitbellew

Copy link
Copy Markdown
Collaborator

PlatformPollingScheduler created its ScheduledExecutorService with non-daemon threads and never shut it down (cancel() only cancels the scheduled task), so the poller thread outlived the work. In the CLI this is masked because main calls System.exit, but it leaks a thread in any long-lived embedder and makes a forked JVM (e.g. a benchmark) hang until a 30s shutdown timeout. Make the poller a daemon thread; TermDisplay.end already does the final render synchronously.

PlatformPollingScheduler created its ScheduledExecutorService with
non-daemon threads and never shut it down (cancel() only cancels the
scheduled task), so the poller thread outlived the work. In the CLI
this is masked because main calls System.exit, but it leaks a thread
in any long-lived embedder and makes a forked JVM (e.g. a benchmark)
hang until a 30s shutdown timeout. Make the poller a daemon thread;
TermDisplay.end already does the final render synchronously.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kitbellew
kitbellew merged commit 48d35de into scalameta:main Jul 12, 2026
32 checks passed
@kitbellew
kitbellew deleted the termdisplay-daemon branch July 12, 2026 22:37
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