Disable plugins before shutting down EventLoops (#2214)

Because disabling plugins also cancels any pending tasks, there will be no task accessing the eventLoops.

Reimplementation of #1578, fixes #1403
This commit is contained in:
Mystiflow 2017-08-09 13:13:25 +01:00 committed by md-5
parent db266a8484
commit a1f9c2e7d4

View File

@ -404,15 +404,6 @@ public class BungeeCord extends ProxyServer
{
}
getLogger().info( "Closing IO threads" );
eventLoops.shutdownGracefully();
try
{
eventLoops.awaitTermination( Long.MAX_VALUE, TimeUnit.NANOSECONDS );
} catch ( InterruptedException ex )
{
}
if ( reconnectHandler != null )
{
getLogger().info( "Saving reconnect locations" );
@ -441,6 +432,15 @@ public class BungeeCord extends ProxyServer
plugin.getExecutorService().shutdownNow();
}
getLogger().info( "Closing IO threads" );
eventLoops.shutdownGracefully();
try
{
eventLoops.awaitTermination( Long.MAX_VALUE, TimeUnit.NANOSECONDS );
} catch ( InterruptedException ex )
{
}
getLogger().info( "Thank you and goodbye" );
// Need to close loggers after last message!
for ( Handler handler : getLogger().getHandlers() )