From f28dbea777ad60ebca881abee9e8d589cfaf3ba8 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 4 Sep 2021 22:39:25 +0200 Subject: [PATCH] Faster shutdown with unwilling thread --- .../md_5/bungee/api/bungeepluginmanager/PluginUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/md_5/bungee/api/bungeepluginmanager/PluginUtils.java b/src/net/md_5/bungee/api/bungeepluginmanager/PluginUtils.java index 677afa2..5fcc82f 100644 --- a/src/net/md_5/bungee/api/bungeepluginmanager/PluginUtils.java +++ b/src/net/md_5/bungee/api/bungeepluginmanager/PluginUtils.java @@ -74,12 +74,12 @@ public final class PluginUtils { .forEach(thread -> { try { thread.interrupt(); - thread.join(2000); + thread.join(100); if (thread.isAlive()) { - throw new IllegalStateException("Thread " + thread.getName() + " still running"); + ProxyServer.getInstance().getLogger().log(Level.SEVERE, "Could not stop thread " + thread.getName() + " of plugin " + plugin.getDescription().getName() + ". Still running"); } - } catch (Exception t) { - severe("Failed to stop thread that belong to plugin", t, plugin.getDescription().getName()); + } catch (InterruptedException t) { + Thread.currentThread().interrupt(); } }); -- 2.39.5