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,AWL,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.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 18F251F44D for ; Mon, 11 Mar 2024 10:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1710151576; bh=XnbLAieU/1QiGY64HHqZoDme5stx5Y8lJh/YbPMv9C8=; h=From:To:Subject:Date:From; b=DtQ+7YRKRC9L2Dais6pkKftnIo7Y0CB8IrRL9nvbeRMaYAuc9l3BmvEgNWfX/ywkg 198UKPs7EfvuS7ePW2t5ClJKhsCboibaDy7F7lFmHb1yuc1e4agAdVMPXk12MYgiPm z6c+3V56AbOLo6L66YPIs898m46FPnkoZpbCGtZs= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] listener: don't loop on errors Date: Mon, 11 Mar 2024 10:06:15 +0000 Message-ID: <20240311100615.1205974-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Fortunately, this only affects `--multi-accept=' users, with `--multi-accept=-1' users getting infinite loops. I noticed this when EMFILE was reached on my setup, but any error should cause us to give up accept(2) (at least temporarily) and allow work for other items in the event loop to be processed. --- lib/PublicInbox/Listener.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Listener.pm b/lib/PublicInbox/Listener.pm index 4669cf04..c83901b2 100644 --- a/lib/PublicInbox/Listener.pm +++ b/lib/PublicInbox/Listener.pm @@ -41,9 +41,9 @@ sub event_step { # ECONNABORTED is common with bad connections return; } elsif (my $sym = $ERR_WARN{int($!)}) { - warn "W: accept(): $! ($sym)\n"; + return warn "W: accept(): $! ($sym)\n"; } else { - warn "BUG?: accept(): $!\n"; + return warn "BUG?: accept(): $!\n"; } } while ($n--); }