mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Kill Factorio process if it's dected to hang
Send SIGKILL instead of SIGTERM when it's dectected that Factorio hangs on shutdown. This should hopefully resolve the travis ci hanging issuse.
This commit is contained in:
1 parent
246a8031c1
commit
bdf8cd1152
1 file changed
+4
-3
@@ -651,7 +651,8 @@ class FactorioServer extends events.EventEmitter {
|
||||
// There appears to be an race condition where sending SIGTERM
|
||||
// immediatly before the RCON interface comes online causes the
|
||||
// Factorio server to hang. It's also possible the server doesn't
|
||||
// stop if it's stuck with an infinite lua code loop.
|
||||
// stop if it's stuck with an infinite lua code loop. In either
|
||||
// case there's no recovering from it.
|
||||
if (process.platform !== "win32") {
|
||||
let hanged = true;
|
||||
function setAlive(output) { hanged = false; }
|
||||
@@ -659,8 +660,8 @@ class FactorioServer extends events.EventEmitter {
|
||||
|
||||
let timeoutId = setTimeout(() => {
|
||||
if (hanged) {
|
||||
console.error("Factorio appears to have hanged, sending second SIGTERM");
|
||||
this._server.kill();
|
||||
console.error("Factorio appears to have hanged, sending SIGKILL");
|
||||
this._server.kill('SIGKILL');
|
||||
}
|
||||
}, 5000);
|
||||
|
||||
|
||||
Reference in new issue
Block a user