From 2f29b2c3d13d832edd1d8cdb31a9d3db5a30ec75 Mon Sep 17 00:00:00 2001 From: Vishesh Yadav Date: Tue, 9 Jul 2019 14:01:05 -0700 Subject: [PATCH] simulator: Just do a wait() in setupAndRun to avoid destruction It get us out of the ACTOR, never clearing the systemActors, and let simulator call exit(). --- fdbserver/SimulatedCluster.actor.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/fdbserver/SimulatedCluster.actor.cpp b/fdbserver/SimulatedCluster.actor.cpp index fe7c5a1ac2..44a80342ab 100644 --- a/fdbserver/SimulatedCluster.actor.cpp +++ b/fdbserver/SimulatedCluster.actor.cpp @@ -1373,28 +1373,6 @@ void checkExtraDB(const char *testFile, int &extraDB, int &minimumReplication, i ifs.close(); } -// To be called after we stop simulator, so that destructors of each process is -// called with right context, with access to right globals. At this point, we -// also no longer have to protect coordinator addresses. -// TODO: Investigate why this doesn't work when we call before stop(). Some -// earlier permanently failed processes seems to be the reason. -ACTOR Future destroyAllProcesses() { - state ISimulator::ProcessInfo* simProcess = g_simulator.getCurrentProcess(); - state vector processes = g_simulator.getAllProcesses(); - state std::vector::iterator it; - - g_simulator.protectedAddresses.clear(); - for (it = processes.begin(); it != processes.end(); ++it) { - if (*it == simProcess || (*it)->failed) continue; - wait (g_simulator.onProcess(*it, TaskPriority::DefaultYield)); - (*it)->shutdownSignal.send(ISimulator::KillInstantly); - g_simulator.destroyProcess(*it); - } - - wait (g_simulator.onProcess(simProcess, TaskPriority::DefaultYield)); - return Void(); -} - ACTOR void setupAndRun(std::string dataFolder, const char *testFile, bool rebooting, bool restoring, std::string whitelistBinPaths, Reference tlsOptions) { state vector> systemActors; state Optional connFile; @@ -1451,6 +1429,6 @@ ACTOR void setupAndRun(std::string dataFolder, const char *testFile, bool reboot TraceEvent("SimulatedSystemDestruct"); g_simulator.stop(); destructed = true; - wait(destroyAllProcesses()); - systemActors.clear(); + wait(Never()); + ASSERT(false); }