Skip to content

Commit 1692049

Browse files
committed
fix: keep forked child process alive via SIGTERM s-panferov#287
When exporting an array of configs from webpack.config.js, atl crashes. The error message is "channel closed", indicating that a forked child process is dying too soon. This commit changes the Checker class such that it's kill method sends a SIGTERM to the child process rather than a SIGKILL. The child process intercepts this signal and ignores it to ensure it is kept alive. Closes s-panferov#287
1 parent 7138357 commit 1692049

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/checker/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class Checker {
136136
}
137137

138138
kill() {
139-
this.checker.kill('SIGKILL');
139+
this.checker.kill('SIGTERM');
140140
}
141141
}
142142

src/checker/runtime.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ process.on('disconnect', function() {
77
process.exit();
88
});
99

10+
// HACK keepalive for concurrent webpack config
11+
process.on('SIGTERM', function () {
12+
// do nothing
13+
});
14+
1015
import * as path from 'path';
1116
import * as colors from 'colors';
1217
import { findResultFor } from '../helpers';
@@ -231,7 +236,6 @@ function processInit({seq, payload}: Init.Request) {
231236
});
232237
}
233238

234-
235239
replyOk(seq, null);
236240
}
237241

0 commit comments

Comments
 (0)