1
0
Fork 0

Don't listen to procdumps exit code (#6932)

This commit is contained in:
Wilfried Goesgens 2018-10-18 11:36:56 +02:00 committed by Jan
parent 97a6bc58ac
commit b0c91cf80c
2 changed files with 14 additions and 10 deletions

View File

@ -148,10 +148,9 @@ Crash analysis of: ` + JSON.stringify(instanceInfo) + '\n';
function analyzeCoreDumpWindows (instanceInfo) { function analyzeCoreDumpWindows (instanceInfo) {
let cdbOutputFile = fs.getTempFile(); let cdbOutputFile = fs.getTempFile();
const coreFN = instanceInfo.rootDir + '\\' + 'core.dmp';
if (!fs.exists(coreFN)) { if (!fs.exists(instanceInfo.coreFilePattern)) {
print('core file ' + coreFN + ' not found?'); print('core file ' + instanceInfo.coreFilePattern + ' not found?');
return; return;
} }
@ -167,7 +166,7 @@ function analyzeCoreDumpWindows (instanceInfo) {
const args = [ const args = [
'-z', '-z',
coreFN, instanceInfo.coreFilePattern,
'-lines', '-lines',
'-logo', '-logo',
cdbOutputFile, cdbOutputFile,
@ -193,9 +192,9 @@ function checkMonitorAlive (binary, arangod, options, res) {
let rc = statusExternal(arangod.monitor.pid, false); let rc = statusExternal(arangod.monitor.pid, false);
if (rc.status !== 'RUNNING') { if (rc.status !== 'RUNNING') {
arangod.monitor = rc; arangod.monitor = rc;
if (arangod.monitor.exit !== 0) { // procdump doesn't set propper exit codes, check for
// ok, procdump exited with a failure, // dumps that may exist:
// this means it wrote an exception dump. if (fs.exists(arangod.coreFilePattern)) {
print("checkMonitorAlive: marking crashy"); print("checkMonitorAlive: marking crashy");
arangod.monitor.monitorExited = true; arangod.monitor.monitorExited = true;
arangod.monitor.pid = null; arangod.monitor.pid = null;

View File

@ -375,8 +375,13 @@ function makeArgsArangod (options, appDir, role, tmpDir) {
} }
// //////////////////////////////////////////////////////////////////////////////
// / @brief check whether process does bad on the wintendo
// //////////////////////////////////////////////////////////////////////////////
function runProcdump (options, instanceInfo, rootDir, pid) { function runProcdump (options, instanceInfo, rootDir, pid) {
let procdumpArgs = [ ]; let procdumpArgs = [ ];
let dumpFile = fs.join(rootDir, 'core_'+pid + '.dmp');
if (options.exceptionFilter != null) { if (options.exceptionFilter != null) {
procdumpArgs = [ procdumpArgs = [
'-accepteula', '-accepteula',
@ -391,14 +396,14 @@ function runProcdump (options, instanceInfo, rootDir, pid) {
} }
procdumpArgs.push('-ma'); procdumpArgs.push('-ma');
procdumpArgs.push(pid); procdumpArgs.push(pid);
procdumpArgs.push(fs.join(rootDir, 'core.dmp')); procdumpArgs.push(dumpFile);
} else { } else {
procdumpArgs = [ procdumpArgs = [
'-accepteula', '-accepteula',
'-e', '-e',
'-ma', '-ma',
pid, pid,
fs.join(rootDir, 'core.dmp') dumpFile
]; ];
} }
try { try {
@ -406,11 +411,11 @@ function runProcdump (options, instanceInfo, rootDir, pid) {
print("Starting procdump: " + JSON.stringify(procdumpArgs)); print("Starting procdump: " + JSON.stringify(procdumpArgs));
} }
instanceInfo.monitor = executeExternal('procdump', procdumpArgs); instanceInfo.monitor = executeExternal('procdump', procdumpArgs);
instanceInfo.coreFilePattern = dumpFile;
} catch (x) { } catch (x) {
print('failed to start procdump - is it installed?'); print('failed to start procdump - is it installed?');
// throw x; // throw x;
} }
} }
// ////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////