From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 90F8B1F568 for ; Tue, 3 Oct 2023 06:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1696315433; bh=SB4WcLVw2vouTXYj6qzqEZyrFWrLAdPLxgHosAKTILE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=zbnsuLM6oix/OiXEJPgZ95Kiix0vb9+VRk4Nq1jcZYxNxhM6jAjabdR789poMIiGW HCCwPbEHy4ZAQKsdvpUqXKfM9haareDlQiLFAVlfnpjsKV3U/lVjKj8xR/QKtJY+Fu Sod7ORNIpEJkEUMc9gHjysFkk5A8ibBgCoFcZXGI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/8] lei: workers exit after they tell lei-daemon Date: Tue, 3 Oct 2023 06:43:49 +0000 Message-ID: <20231003064352.2902298-6-e@80x24.org> In-Reply-To: <20231003064352.2902298-1-e@80x24.org> References: <20231003064352.2902298-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We don't want workers continuing after their stdout has triggered EPIPE or some other write error. This fixes xt/lei-onion-convert.t to ensure the quit_waiter_pipe is fully-closed at daemon teardown during tests. Using the `exit' perlop still ensures OnDestroy callbacks will fire. --- lib/PublicInbox/LEI.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 817772f7..10c08b90 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -485,6 +485,7 @@ sub x_it ($$) { stop_pager($self); if ($self->{pkt_op_p}) { # worker => lei-daemon $self->{pkt_op_p}->pkt_do('x_it', $code); + exit($code >> 8); } elsif ($self->{sock}) { # lei->daemon => lei(1) client send($self->{sock}, "x_it $code", 0); } elsif ($quit == \&CORE::exit) { # an admin (one-shot) command