mirror of https://gitee.com/bigwinds/arangodb
Be more gracefully when shutting down, however, alarm if we take longer than 10s for shutdown.
This commit is contained in:
parent
786d7e1947
commit
bc4a77828b
|
@ -445,7 +445,7 @@ function shutdownInstance (instanceInfo, options) {
|
||||||
for (var i in rc.serverStates) {
|
for (var i in rc.serverStates) {
|
||||||
if (rc.serverStates.hasOwnProperty(i)){
|
if (rc.serverStates.hasOwnProperty(i)){
|
||||||
if (rc.serverStates[i].hasOwnProperty('signal')) {
|
if (rc.serverStates[i].hasOwnProperty('signal')) {
|
||||||
print("Server shut down with : " + rc.serverStates[i] + " marking run as crashy.");
|
print("Server shut down with : " + JSON.stringify(rc.serverStates[i]) + " marking run as crashy.");
|
||||||
serverCrashed = true;
|
serverCrashed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -459,6 +459,7 @@ function shutdownInstance (instanceInfo, options) {
|
||||||
|
|
||||||
print("Waiting for server shut down");
|
print("Waiting for server shut down");
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
var bar = "[";
|
||||||
while (1) {
|
while (1) {
|
||||||
instanceInfo.exitStatus = statusExternal(instanceInfo.pid, false);
|
instanceInfo.exitStatus = statusExternal(instanceInfo.pid, false);
|
||||||
if (instanceInfo.exitStatus.status === "RUNNING") {
|
if (instanceInfo.exitStatus.status === "RUNNING") {
|
||||||
|
@ -466,8 +467,11 @@ function shutdownInstance (instanceInfo, options) {
|
||||||
if (typeof(options.valgrind) === 'string') {
|
if (typeof(options.valgrind) === 'string') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (count > 10) {
|
if (count % 10 ===0) {
|
||||||
print("forcefully terminating " + instanceInfo.pid + " after 10 s grace period.");
|
bar = bar + "#";
|
||||||
|
}
|
||||||
|
if (count > 600) {
|
||||||
|
print("forcefully terminating " + JSON.stringify(instanceInfo.pid) + " after 600 s grace period.");
|
||||||
serverCrashed = true;
|
serverCrashed = true;
|
||||||
killExternal(instanceInfo.pid);
|
killExternal(instanceInfo.pid);
|
||||||
break;
|
break;
|
||||||
|
@ -478,7 +482,7 @@ function shutdownInstance (instanceInfo, options) {
|
||||||
}
|
}
|
||||||
else if (instanceInfo.exitStatus.status !== "TERMINATED") {
|
else if (instanceInfo.exitStatus.status !== "TERMINATED") {
|
||||||
if (instanceInfo.exitStatus.hasOwnProperty('signal')) {
|
if (instanceInfo.exitStatus.hasOwnProperty('signal')) {
|
||||||
print("Server shut down with : " + instanceInfo.exitStatus + " marking build as crashy.");
|
print("Server shut down with : " + JSON.stringify(instanceInfo.exitStatus) + " marking build as crashy.");
|
||||||
serverCrashed = true;
|
serverCrashed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -487,6 +491,9 @@ function shutdownInstance (instanceInfo, options) {
|
||||||
break; // Success.
|
break; // Success.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (count > 10) {
|
||||||
|
print("long Server shutdown: " + bar + ']');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print("Server already dead, doing nothing.");
|
print("Server already dead, doing nothing.");
|
||||||
|
@ -1599,6 +1606,9 @@ function unitTestPrettyPrintResults(r) {
|
||||||
if (r.all_ok !== true) {
|
if (r.all_ok !== true) {
|
||||||
print(" Suites failed: " + testSuiteFail + " Tests Failed: " + testFail);
|
print(" Suites failed: " + testSuiteFail + " Tests Failed: " + testFail);
|
||||||
}
|
}
|
||||||
|
if (r.crashed === true) {
|
||||||
|
print(" We had at least one unclean shutdown of an arangod during the testrun.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (x) {
|
catch (x) {
|
||||||
print("exception caught while pretty printing result: ");
|
print("exception caught while pretty printing result: ");
|
||||||
|
|
Loading…
Reference in New Issue