Allow load at boot to be cancelled with a shutdown command

Former-commit-id: 2897a59e59bed14a67d1d0abcec5cb6a71bbb15b
This commit is contained in:
John Sully 2021-11-13 18:39:03 +00:00
parent 553f49507d
commit 6eae02919a
2 changed files with 10 additions and 1 deletions

View File

@ -2665,6 +2665,9 @@ public:
}
~rdbAsyncWorkThread() {
fExit = true;
while (m_lockPause.fOwnLock())
m_lockPause.unlock();
if (m_thread.joinable())
endWork();
}

View File

@ -7394,7 +7394,13 @@ int main(int argc, char **argv) {
}
InitServerLast();
loadDataFromDisk();
try {
loadDataFromDisk();
} catch (ShutdownException) {
exit(EXIT_SUCCESS);
}
if (g_pserver->cluster_enabled) {
if (verifyClusterConfigWithData() == C_ERR) {
serverLog(LL_WARNING,