next-issue 6.6.114 → 6.6.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/children.mjs +8 -1
- package/dist/serve.mjs +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -391,12 +391,13 @@ Press `Ctrl-C` to stop the run step by step:
|
|
|
391
391
|
branch that this press kills before any job restarted runs again in the
|
|
392
392
|
next run, before any fixer.
|
|
393
393
|
|
|
394
|
-
`SIGTERM`
|
|
395
|
-
|
|
394
|
+
`SIGTERM` or `SIGHUP` (its terminal or ssh session closes) to a
|
|
395
|
+
command-line run while a command or an agent runs, and `SIGTERM`, `SIGHUP`
|
|
396
|
+
or `SIGINT` to the worker (`next-issue stop` sends `SIGTERM`), act like
|
|
396
397
|
the third press: they stop the running harness commands and agents, with
|
|
397
398
|
the commands the agents started, and give back the review round, the check
|
|
398
|
-
fix and the rerun in the same way. When nothing runs, `SIGTERM`
|
|
399
|
-
command-line run at once.
|
|
399
|
+
fix and the rerun in the same way. When nothing runs, `SIGTERM` or `SIGHUP`
|
|
400
|
+
ends a command-line run at once.
|
|
400
401
|
|
|
401
402
|
When the reviewer approved the change and the run stopped before its
|
|
402
403
|
commit reached the base branch, the next run drops those edits and any
|
|
@@ -831,7 +832,7 @@ affect another. The worker:
|
|
|
831
832
|
holds it;
|
|
832
833
|
- closes once no run is going when a client with a newer version connects, so
|
|
833
834
|
that the client can start the newer worker;
|
|
834
|
-
- stops every agent and command and exits on `SIGTERM` or `SIGINT`, and
|
|
835
|
+
- stops every agent and command and exits on `SIGTERM`, `SIGHUP` or `SIGINT`, and
|
|
835
836
|
removes its socket and lock files;
|
|
836
837
|
- keeps `.next-issue/worker.log`, where the extension writes the output of
|
|
837
838
|
the worker, within 10 MiB: when it starts and once a minute while it runs,
|
package/dist/children.mjs
CHANGED
|
@@ -65,18 +65,25 @@ export function stopChildren(signal) {
|
|
|
65
65
|
}
|
|
66
66
|
undos.clear();
|
|
67
67
|
process.off('SIGTERM', onTerminate);
|
|
68
|
+
process.off('SIGHUP', onHangUp);
|
|
68
69
|
process.kill(process.pid, signal);
|
|
69
70
|
}
|
|
70
71
|
const onTerminate = () => stopChildren('SIGTERM');
|
|
71
|
-
|
|
72
|
+
const onHangUp = () => stopChildren('SIGHUP');
|
|
73
|
+
/**
|
|
74
|
+
* Handles `SIGTERM` and `SIGHUP` (a closed terminal) while a command or an agent runs,
|
|
75
|
+
* so its process group is stopped too.
|
|
76
|
+
*/
|
|
72
77
|
function guard() {
|
|
73
78
|
if (groups.size === 0 && stoppers.size === 0) {
|
|
74
79
|
process.on('SIGTERM', onTerminate);
|
|
80
|
+
process.on('SIGHUP', onHangUp);
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
function unguard() {
|
|
78
84
|
if (groups.size === 0 && stoppers.size === 0) {
|
|
79
85
|
process.off('SIGTERM', onTerminate);
|
|
86
|
+
process.off('SIGHUP', onHangUp);
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
export function watch(pid) {
|
package/dist/serve.mjs
CHANGED
|
@@ -157,13 +157,16 @@ export async function serve(root, logCheckMs = LOG_CHECK_MS) {
|
|
|
157
157
|
const end = (signal) => {
|
|
158
158
|
process.off('SIGTERM', onTerminate);
|
|
159
159
|
process.off('SIGINT', onInterrupt);
|
|
160
|
+
process.off('SIGHUP', onHangUp);
|
|
160
161
|
worker.release();
|
|
161
162
|
stopChildren(signal);
|
|
162
163
|
};
|
|
163
164
|
const onTerminate = () => end('SIGTERM');
|
|
164
165
|
const onInterrupt = () => end('SIGINT');
|
|
166
|
+
const onHangUp = () => end('SIGHUP');
|
|
165
167
|
process.on('SIGTERM', onTerminate);
|
|
166
168
|
process.on('SIGINT', onInterrupt);
|
|
169
|
+
process.on('SIGHUP', onHangUp);
|
|
167
170
|
process.stderr.write(`next-issue: worker listening on ${paths.socketPath}\n`);
|
|
168
171
|
await worker.closed;
|
|
169
172
|
stopTrimming();
|