]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ipc: eliminate ipc_worker_stop method
authorEric Wong <e@80x24.org>
Sun, 10 Jan 2021 12:15:05 +0000 (12:15 +0000)
committerEric Wong <e@80x24.org>
Tue, 12 Jan 2021 03:51:42 +0000 (03:51 +0000)
We can just EOF the pipe, and instead rely on per-class
error handling to deal with uncommitted transactions and
what not.

lib/PublicInbox/IPC.pm

index 27ea90de44634f690f5b744a21549272ba6b3498..0c5205c12c6561c1c8960f36c1044ddef410f9c3 100644 (file)
@@ -136,12 +136,6 @@ sub ipc_worker_reap { # dwaitpid callback
 sub ipc_atfork_parent {}
 sub ipc_atfork_child {}
 
-# should only be called inside the worker process
-sub ipc_worker_exit {
-       my (undef, $code) = @_;
-       exit($code);
-}
-
 # idempotent, can be called regardless of whether worker is active or not
 sub ipc_worker_stop {
        my ($self) = @_;
@@ -152,10 +146,8 @@ sub ipc_worker_stop {
                return; # idempotent
        }
        die 'no PID with IPC pipes' unless $pid;
-       _send_rec($w_req, [ undef, 'ipc_worker_exit', 0 ]);
        $w_req = $r_res = undef;
 
-       # allow any sibling to send ipc_worker_exit, but siblings can't wait
        return if $$ != $ppid;
        dwaitpid($pid, \&ipc_worker_reap, $self);
 }