Skip to content

ide-terminal: run ttyd on daemon threads and destroy it on context close (#8225) - #8304

Open
d-velev wants to merge 1 commit into
eclipse-dirigible:masterfrom
d-velev:issue-8225-ttyd-daemon-threads
Open

d-velev wants to merge 1 commit into
eclipse-dirigible:masterfrom
d-velev:issue-8225-ttyd-daemon-threads

Conversation

@d-velev

@d-velev d-velev commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

A failed startup left the container Up with no HTTP listener: SpringApplication.run rethrows and main exits, but the two non-daemon reader threads in ProcessRunnable (and the launcher thread) kept the JVM alive, so no Docker restart policy fired.

Changes (components/ide/ide-terminal):

  • ProcessRunnable spawns its stdout/stderr reader threads as named daemon threads and exposes destroy() to stop the process.
  • TerminalWebsocketConfig starts ttyd from a @PostConstruct hook on a daemon launcher thread (replacing the static-initializer start that ran before context refresh) and destroys it from @PreDestroy, so ttyd no longer outlives a closed context.

With the reader threads daemon, a refresh failure lets the JVM exit non-zero as expected.

Verified: ide-terminal unit suite green (new ProcessRunnableTest + existing); formatter:validate green with the cache wiped. The Docker-level exit/restart behavior was reproduced by the reporter and is not covered by the IT harness.

Fixes #8225

🤖 Generated with Claude Code

…ose (eclipse-dirigible#8225)

A failed startup left the container Up with no HTTP listener: SpringApplication.run
rethrows, main exits, but the two non-daemon reader threads in ProcessRunnable (and the
launcher thread) kept the JVM alive, so no Docker restart policy fired.

- ProcessRunnable now spawns its stdout/stderr reader threads as named daemon threads and
  exposes destroy() to stop the process.
- TerminalWebsocketConfig starts ttyd from a @PostConstruct lifecycle hook on a daemon
  launcher thread (replacing the static-initializer start that ran before context refresh)
  and destroys it from @PreDestroy, so ttyd no longer outlives a closed context.

With the reader threads daemon, a refresh failure lets the JVM exit non-zero as expected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

A failed startup never exits the JVM: the terminal's non-daemon ttyd reader threads keep the container Up with no listener, so no restart policy fires

1 participant