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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 8642D1F54E for ; Tue, 16 Aug 2022 03:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1660621443; bh=UvCHbIE/8/MBpzv1AWJx9SlSouJNXAT0Sl/aEWhmcGA=; h=From:To:Subject:Date:From; b=yQRFBVaw016kuxP/RYkvNi3Vkrila6lmNSimemrqRa2dHoNKfyJd5ZjqrAbewGftB kWRPl8q4xopWX5kqGzsuaiCudjwaRsZKKK6udFGM2cs3HxI4tTCvHbzy5l5mSjnzNn ZBSDzc3CJIqltORqE/CTvzAxZuSRBVLnAZGYtLTU= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei: do not wait for sto->done on disconnected EOF Date: Tue, 16 Aug 2022 03:44:03 +0000 Message-Id: <20220816034403.3646369-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: lei-daemon (the top-level daemon process) should not have synchronous waits, and this was causing a deadlock with interrupted commands. There may still be a bug lurking in lei/store despite this fix, though. I originally thought commit fd261b9e65674505 (lei_store_err: use level-trigger for error pipe, 2022-08-15) was sufficient, but at least this change is needed, as well. --- lib/PublicInbox/LEI.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index d81ca296..595b3fa9 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -1520,13 +1520,10 @@ sub sto_done_request { return unless $lei->{sto}; local $current_lei = $lei; my $sock = $wq ? $wq->{lei_sock} : undef; - eval { - if ($sock //= $lei->{sock}) { # issue, async wait - $lei->{sto}->wq_io_do('done', [ $sock ]); - } else { # forcibly wait - my $wait = $lei->{sto}->wq_do('done'); - } - }; + $sock //= $lei->{sock}; + my @io; + push(@io, $sock) if $sock; # async wait iff possible + eval { $lei->{sto}->wq_io_do('done', \@io) }; warn($@) if $@; }