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
This commit is contained in:
John Sully 2020-05-24 01:56:23 -04:00
parent aaff167eb9
commit dde860c60b

View File

@ -3473,7 +3473,12 @@ void processEventsWhileBlocked(int iel) {
AeLocker locker; AeLocker locker;
locker.arm(nullptr); locker.arm(nullptr);
locker.release(); locker.release();
for (client *c : vecclients) for (client *c : vecclients)
c->lock.lock(); 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();
} }