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.