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,AWL,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 50F081F8C8 for ; Tue, 14 Sep 2021 02:39:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/5] lei: warn on event loop errors Date: Tue, 14 Sep 2021 02:39:01 +0000 Message-Id: <20210914023905.21410-2-e@80x24.org> In-Reply-To: <20210914023905.21410-1-e@80x24.org> References: <20210914023905.21410-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This should help us notice (and fix) bugs more easily. --- lib/PublicInbox/LEI.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 784e679d..f0caac03 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -1347,7 +1347,8 @@ sub lazy_start { open STDERR, '>&STDIN' or die "redirect stderr failed: $!"; open STDOUT, '>&STDIN' or die "redirect stdout failed: $!"; # $daemon pipe to `lei' closed, main loop begins: - PublicInbox::DS->EventLoop; + eval { PublicInbox::DS->EventLoop }; + warn "event loop error: $@\n" if $@; dump_and_clear_log(); exit($exit_code // 0); }