Skip to content

Terminate lingering server processes after shutdown - #748

Merged
robstryker merged 1 commit into
redhat-developer:masterfrom
robstryker:fix-zombie-process-on-shutdown
Aug 26, 2026
Merged

Terminate lingering server processes after shutdown#748
robstryker merged 1 commit into
redhat-developer:masterfrom
robstryker:fix-zombie-process-on-shutdown

Conversation

@robstryker

Copy link
Copy Markdown
Collaborator

Summary

  • When a server's HTTP port stops responding but the JVM process doesn't exit (e.g., non-daemon threads or hung shutdown hooks in the deployed application), the framework declares the server stopped without killing the process
  • On the next start, the old launch reference is overwritten, orphaning the JVM — repeated restarts accumulate zombie processes until memory is exhausted
  • Overrides shutdownServerResultListener() in GenericServerBehavior to schedule a non-blocking background cleanup after the poller confirms the port is down — a daemon thread waits 2 minutes for the process to exit naturally, then force-terminates any survivors

🤖 Generated with Claude Code

When a server's HTTP port goes down but its JVM process doesn't exit
(e.g., non-daemon threads or hung shutdown hooks in the deployed app),
the framework declares the server stopped without killing the process.
On the next start, the old launch reference is overwritten, orphaning
the JVM. Repeated restarts accumulate zombie processes until memory
is exhausted.

Override shutdownServerResultListener() in GenericServerBehavior to
schedule a background cleanup after the poller confirms the port is
down. A daemon thread waits 2 minutes for the process to exit on its
own, then force-terminates any survivors.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@robstryker
robstryker merged commit a5c044a into redhat-developer:master Aug 26, 2026
1 check passed
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