(progressPath, fields)
| 453 | // wrapper treats the inner core as zombie and SIGKILLs it. See Issue #19 (the |
| 454 | // 22-day stuck-cycle incident) and the cross-repo timeout plan for context. |
| 455 | function writeCycleProgressAtomic(progressPath, fields) { |
| 456 | try { |
| 457 | const data = Object.assign({}, fields, { updated_at: Date.now() }); |
| 458 | const tmp = progressPath + '.tmp.' + process.pid; |
| 459 | fs.writeFileSync(tmp, JSON.stringify(data, null, 2) + '\n', 'utf8'); |
| 460 | fs.renameSync(tmp, progressPath); |
| 461 | return true; |
| 462 | } catch (e) { |
| 463 | return false; |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | function handleCycleTimeout({ error, cycleProgressPath, progressFields, suicideEnabled, args, logPath, spawnReplacementFn }) { |
| 468 | const msg = error && error.message ? String(error.message) : String(error); |
no outgoing calls
no test coverage detected