From dde860c60bd767155cf01cf80cca7f01bb9b91ca Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 24 May 2020 01:56:23 -0400 Subject: [PATCH] If we request shutdown from a client on a different thread than a blocking lua script we fail to actually shutdown until the script completes Former-commit-id: 1ca6c1dd56131bc28fe9f831e2b9cab7adb846a3 --- src/networking.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/networking.cpp b/src/networking.cpp index af97f229b..e3e0b0e00 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -3473,7 +3473,12 @@ void processEventsWhileBlocked(int iel) { AeLocker locker; locker.arm(nullptr); locker.release(); + for (client *c : vecclients) c->lock.lock(); + + // If a different thread processed the shutdown we need to abort the lua command or we will hang + if (serverTL->el->stop) + throw ShutdownException(); }