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 68ACF1FD5A for ; Thu, 21 Oct 2021 21:10:33 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 08/15] watch: check for {quit} before IDLE Date: Thu, 21 Oct 2021 21:10:25 +0000 Message-Id: <20211021211032.22666-9-e@80x24.org> In-Reply-To: <20211021211032.22666-1-e@80x24.org> References: <20211021211032.22666-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This may make it less likely for watch-dependent tests to get stuck. Unfortunately, due to the synchronous API of Mail::IMAPClient, ->idle is still susceptible to missing signals. --- lib/PublicInbox/Watch.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/Watch.pm b/lib/PublicInbox/Watch.pm index b48d9cccc3e2..e80bbdec16fd 100644 --- a/lib/PublicInbox/Watch.pm +++ b/lib/PublicInbox/Watch.pm @@ -330,6 +330,7 @@ sub imap_idle_once ($$$$) { my $end = now() + $intvl; warn "I: $uri idling for ${intvl}s\n"; local $0 = "IDLE $0"; + return if $self->{quit}; unless ($mic->idle) { return if $self->{quit}; return "E: IDLE failed on $uri: $!";