Skip to content

Undertow doesn't shut down properly if there is a startup error (e.g., port already in use) #10528

@brianloss

Description

@brianloss

Working with Spring Boot 1.5.6 (but glancing at the code I think it might still be a problem even on master).
If I start an app that uses Undertow, and startup fails due to an error such as port in use, then the app is left running. The reason is that Undertow.start is called, and it starts up non-daemon XNIO threads before throwing the exception due to port in use. This exception is caught in UndertowEmbeddedServletContainer.start, however the member variable started has not been set to true since startup failed. Then, UndertowEmbeddedServletContainer.stop is called later in response to the startup failure, but it does nothing since the startup variable is false. It seems calling Undertow.stop() in the exception handler would cause the XNIO threads to be stopped and therefore allow the application to exit.

Metadata

Metadata

Assignees

Labels

status: supersededAn issue that has been superseded by anothertype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions