From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 25A271FB05 for ; Sun, 10 Jan 2021 12:15:20 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 08/22] ipc: eliminate ipc_worker_stop method Date: Sun, 10 Jan 2021 12:15:05 +0000 Message-Id: <20210110121519.17044-9-e@80x24.org> In-Reply-To: <20210110121519.17044-1-e@80x24.org> References: <20210110121519.17044-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm index 27ea90de..0c5205c1 100644 --- a/lib/PublicInbox/IPC.pm +++ b/lib/PublicInbox/IPC.pm @@ -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); }