diff --git a/gradle.properties b/gradle.properties index d4524ed60c80..d8bddf4c5b6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=3.5.5-SNAPSHOT +version=3.5.5 latestVersion=false spring.build-type=oss diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java index 34c70f95f89e..f8c1972b8075 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java @@ -278,13 +278,30 @@ public void stop() throws WebServerException { notifyGracefulCallback(false); } try { - this.undertow.stop(); + if (this.undertow != null) { + this.undertow.stop(); + } + } + catch (Exception ex) { + throw new WebServerException("Unable to stop embedded Undertow", ex); + } + } + } + + @Override + public void destroy() { + synchronized (this.monitor) { + try { + if (this.started && this.undertow != null) { + this.started = false; + this.undertow.stop(); + } for (Closeable closeable : this.closeables) { closeable.close(); } } catch (Exception ex) { - throw new WebServerException("Unable to stop Undertow", ex); + throw new WebServerException("Unable to stop embedded Undertow", ex); } } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java index 9fb0cf5c405d..46cf2c3bcfe3 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java @@ -255,18 +255,6 @@ protected void portClashOfSecondaryConnectorResultsInPortInUseException() throws super.portClashOfSecondaryConnectorResultsInPortInUseException(); } - @Test - @Override - @Disabled("Restart after stop is not supported with Undertow") - protected void restartAfterStop() { - } - - @Test - @Override - @Disabled("Undertow's architecture prevents separating stop and destroy") - protected void servletContextListenerContextDestroyedIsNotCalledWhenContainerIsStopped() { - } - private void testAccessLog(String prefix, String suffix, String expectedFile) throws IOException, URISyntaxException { UndertowServletWebServerFactory factory = getFactory();