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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,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 07A7D1F9E5 for ; Tue, 8 Jun 2021 09:50:22 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] lei: safety fix for multiple WQ classes Date: Tue, 8 Jun 2021 09:50:19 +0000 Message-Id: <20210608095021.20034-2-e@80x24.org> In-Reply-To: <20210608095021.20034-1-e@80x24.org> References: <20210608095021.20034-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: For commands utilizing multiple workers, this simple change generalizes the persistence mechanism and and prevents lei->dclose from causing script/lei to exit if there are still in-flight workers. This ougth to prevent read-after-write consistency problems that occasionally manifest in scripts (e.g. test cases) but usually go unnoticed in normal use. --- lib/PublicInbox/LEI.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 8adf70fa..0cf4d10b 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -580,6 +580,8 @@ sub workers_start { $wq->wq_workers_start($ident, $jobs, $lei->oldset, { lei => $lei }); delete $lei->{pkt_op_p}; my $op_c = delete $lei->{pkt_op_c}; + # {-lei_sock} persists script/lei process until ops->{''} EOF callback + $op_c->{-lei_sock} = $lei->{sock}; @$end = (); $lei->event_step_init; ($op_c, $ops);