From 6c1b5982a5577d6110ce8c985424f823673bd6cc Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 5 Aug 2019 21:08:55 +0200 Subject: [PATCH] Fixes #3929 - Deadlock between new HTTP2Connection() and Server.stop(). Previously beans were started if they were not running, which included them being in a STOPPING state. Now beans are only started if they are in STOPPED state. Signed-off-by: Simone Bordet --- .../jetty/util/component/ContainerLifeCycle.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java index 139b7d90895..a17cf87e3a8 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java @@ -106,18 +106,20 @@ public class ContainerLifeCycle extends AbstractLifeCycle implements Container, switch (b._managed) { case MANAGED: - if (!l.isRunning()) + if (l.isStopped()) start(l); break; case AUTO: - if (l.isRunning()) - unmanage(b); - else + if (l.isStopped()) { manage(b); start(l); } + else + { + unmanage(b); + } break; default: @@ -142,7 +144,7 @@ public class ContainerLifeCycle extends AbstractLifeCycle implements Container, { try { - l.stop(); + stop(l); } catch (Throwable cause2) {