about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-18 10:53:32 +0000
committerEric Wong <e@80x24.org>2016-06-18 21:48:25 +0000
commite748f75979046724ead380bd00eadc677bdc07e9 (patch)
treefbcd16686324cc689a1cd1b0de642bc9a9881601 /t
parent1701875544e31d77f65cf467a35c8dd2bcebf8fa (diff)
downloadpublic-inbox-e748f75979046724ead380bd00eadc677bdc07e9.tar.gz
While we only want to stop our daemons and gracefully destroy
subprocesses, it is common for 'Ctrl-C' from a terminal to kill
the entire pgroup.

Killing an entire pgroup nukes subprocesses like git-upload-pack
breaks graceful shutdown on long clones.  Make a best effort to
ensure git-upload-pack processes are not broken when somebody
signals an entire process group.

Followup-to: commit 37bf2db81bbbe114d7fc5a00e30d3d5a6fa74de5
("doc: systemd examples should only kill one process")
Diffstat (limited to 't')
-rw-r--r--t/spawn.t2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/spawn.t b/t/spawn.t
index 9e58f675..0f756462 100644
--- a/t/spawn.t
+++ b/t/spawn.t
@@ -87,7 +87,7 @@ use PublicInbox::Spawn qw(which spawn popen_rd);
         is(kill(0, $pid), 1, 'child process is running');
         ok(!defined(sysread($fh, my $buf, 1)) && $!{EAGAIN},
            'sysread returned quickly with EAGAIN');
-        is(kill(15, $pid), 1, 'child process killed early');
+        is(kill(9, $pid), 1, 'child process killed early');
         is(waitpid($pid, 0), $pid, 'child process reapable');
         isnt($?, 0, '$? set properly: '.$?);
 }