From 3537d255b579018851951da08262cd0178e40c66 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Thu, 21 Aug 2025 10:59:13 +0200 Subject: [PATCH 1/2] Release v3.5.5 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 4483b239ef59fbef2ec575e6462c397688fad9d5 Mon Sep 17 00:00:00 2001 From: hdfg159 Date: Wed, 10 Sep 2025 16:07:35 +0800 Subject: [PATCH 2/2] Add UndertowWebServer.destroy method as the final resource cleanup. --- .../embedded/undertow/UndertowWebServer.java | 21 +++++++++++++++++-- .../UndertowServletWebServerFactoryTests.java | 12 ----------- 2 files changed, 19 insertions(+), 14 deletions(-) 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();