diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java index 3edf45b3760..405ce12f6fa 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java @@ -157,7 +157,7 @@ public class ShutdownMonitor extends Thread return; } - while (true) + while (serverSocket != null) { Socket socket = null; try @@ -190,7 +190,9 @@ public class ShutdownMonitor extends Thread // Shutdown Monitor debug("Shutting down monitor"); close(socket); + socket = null; close(serverSocket); + serverSocket = null; if (exitVm) {