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 <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-08-05 21:08:55 +02:00
parent ab015f2653
commit 6c1b5982a5
1 changed files with 7 additions and 5 deletions

View File

@ -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)
{