Skip to content

Shutdown HTTPServer executor service to avoid non-daemon threads potentially blocking exiting JVM#303

Merged
brian-brazil merged 1 commit intoprometheus:masterfrom
marcelmay:httpserver-clean-shutdown
Oct 16, 2017
Merged

Shutdown HTTPServer executor service to avoid non-daemon threads potentially blocking exiting JVM#303
brian-brazil merged 1 commit intoprometheus:masterfrom
marcelmay:httpserver-clean-shutdown

Conversation

@marcelmay
Copy link
Copy Markdown
Contributor

The HTTPServer creates a Java ExecutorService but does not shut it down when stopping the HTTPServer.

As the default executor service creates non-daemon threads, this will cause the JVM to hang if the JVM does not exist using a forced System.exit(...).

@brian-brazil : This happens currently when using the latest jmx_exporter (disable the System.exit(...) in TestApplication to reproduce/verify).

@marcelmay marcelmay changed the title Shutdown HTTPServer executor service to avoid non-daemon threads potentially blocking exiting JVMs Shutdown HTTPServer executor service to avoid non-daemon threads potentially blocking exiting JVM Oct 16, 2017
@marcelmay
Copy link
Copy Markdown
Contributor Author

Just saw related PR #300

@brian-brazil brian-brazil merged commit 4f64a6c into prometheus:master Oct 16, 2017
@brian-brazil
Copy link
Copy Markdown
Contributor

Thanks!

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.

2 participants