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 E07B11FA1A for ; Wed, 28 Apr 2021 07:52:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/11] lei: quiet down Eml-related warnings consistently Date: Wed, 28 Apr 2021 07:52:01 +0000 Message-Id: <20210428075205.19440-8-e@80x24.org> In-Reply-To: <20210428075205.19440-1-e@80x24.org> References: <20210428075205.19440-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: "lei import" is probably the only place where it users might care about warnings. --- lib/PublicInbox/LEI.pm | 3 +++ lib/PublicInbox/LeiBlob.pm | 1 - lib/PublicInbox/LeiConvert.pm | 1 - lib/PublicInbox/LeiImport.pm | 1 + lib/PublicInbox/LeiP2q.pm | 4 +--- lib/PublicInbox/LeiStore.pm | 1 - lib/PublicInbox/LeiXSearch.pm | 1 - 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index a949ae3e..cfbf12f0 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -23,6 +23,7 @@ use PublicInbox::Sigfd; use PublicInbox::DS qw(now dwaitpid); use PublicInbox::Spawn qw(spawn popen_rd); use PublicInbox::Lock; +use PublicInbox::Eml; use Time::HiRes qw(stat); # ctime comparisons for config cache use File::Path qw(mkpath); use File::Spec; @@ -509,6 +510,8 @@ sub _lei_atfork_child { %PATH2CFG = (); undef $errors_log; $quit = \&CORE::exit; + $self->{-eml_noisy} or # only "lei import" sets this atm + $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); $current_lei = $persist ? undef : $self; # for SIG{__WARN__} } diff --git a/lib/PublicInbox/LeiBlob.pm b/lib/PublicInbox/LeiBlob.pm index 0b96bd04..ff079e65 100644 --- a/lib/PublicInbox/LeiBlob.pm +++ b/lib/PublicInbox/LeiBlob.pm @@ -167,7 +167,6 @@ EOM sub ipc_atfork_child { my ($self) = @_; $self->{lei}->_lei_atfork_child; - $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); $self->SUPER::ipc_atfork_child; } diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm index 0c324169..14bed901 100644 --- a/lib/PublicInbox/LeiConvert.pm +++ b/lib/PublicInbox/LeiConvert.pm @@ -68,7 +68,6 @@ sub ipc_atfork_child { $net->{mics_cached} = $net->imap_common_init($lei); $net->{nn_cached} = $net->nntp_common_init($lei); } - $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); $l2m->pre_augment($lei); $l2m->do_augment($lei); $l2m->post_augment($lei); diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index e0d899cc..f2a0c95a 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -93,6 +93,7 @@ sub lei_import { # the main "lei import" method my $ops = {}; $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; $self->{-wq_nr_workers} = $j // 1; # locked + $lei->{-eml_noisy} = 1; (my $op_c, $ops) = $lei->workers_start($self, 'lei-import', $j, $ops); $lei->{imp} = $self; net_merge_complete($self) unless $lei->{auth}; diff --git a/lib/PublicInbox/LeiP2q.pm b/lib/PublicInbox/LeiP2q.pm index 07357e32..deb31974 100644 --- a/lib/PublicInbox/LeiP2q.pm +++ b/lib/PublicInbox/LeiP2q.pm @@ -197,9 +197,7 @@ sub lei_p2q { # the "lei patch-to-query" entry point sub ipc_atfork_child { my ($self) = @_; - my $lei = $self->{lei}; - $lei->_lei_atfork_child; - $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); + $self->{lei}->_lei_atfork_child; $self->SUPER::ipc_atfork_child; } diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 1cf7ffc1..fcc9224d 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -411,7 +411,6 @@ sub ipc_atfork_child { close $err->[0]; $self->{-err_wr} = $err->[1]; } - $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); $self->SUPER::ipc_atfork_child; } diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 018b60f9..b3fd79d0 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -443,7 +443,6 @@ sub incr_start_query { # called whenever an l2m shard starts do_post_auth sub ipc_atfork_child { my ($self) = @_; $self->{lei}->_lei_atfork_child; - $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); $self->SUPER::ipc_atfork_child; }