summaryrefslogtreecommitdiff
path: root/ndb/src/kernel/vm/Emulator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ndb/src/kernel/vm/Emulator.cpp')
-rw-r--r--ndb/src/kernel/vm/Emulator.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp
index 75aea2bda7f..202c6547a81 100644
--- a/ndb/src/kernel/vm/Emulator.cpp
+++ b/ndb/src/kernel/vm/Emulator.cpp
@@ -61,6 +61,7 @@ Uint32 theEmulatedJamBlockNumber = 0;
EmulatorData globalEmulatorData;
NdbMutex * theShutdownMutex = 0;
+int simulate_error_during_shutdown= 0;
EmulatorData::EmulatorData(){
theConfiguration = 0;
@@ -117,7 +118,8 @@ NdbShutdown(NdbShutdownType type,
}
}
- if(NdbMutex_Trylock(theShutdownMutex) == 0){
+ if((type == NST_ErrorHandlerSignal) || // Signal handler has already locked mutex
+ (NdbMutex_Trylock(theShutdownMutex) == 0)){
globalData.theRestartFlag = perform_stop;
bool restart = false;
@@ -145,6 +147,9 @@ NdbShutdown(NdbShutdownType type,
case NST_ErrorHandler:
ndbout << "Error handler " << shutting << " system" << endl;
break;
+ case NST_ErrorHandlerSignal:
+ ndbout << "Error handler signal " << shutting << " system" << endl;
+ break;
case NST_Restart:
ndbout << "Restarting system" << endl;
break;
@@ -175,6 +180,12 @@ NdbShutdown(NdbShutdownType type,
#endif
}
+ if (simulate_error_during_shutdown) {
+ kill(getpid(), simulate_error_during_shutdown);
+ while(true)
+ NdbSleep_MilliSleep(10);
+ }
+
globalEmulatorData.theWatchDog->doStop();
#ifdef VM_TRACE