From: Eric Wong Date: Wed, 17 Dec 2025 23:39:15 +0000 (+0000) Subject: www: disable leak detector in existing code paths X-Git-Tag: v2.1.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb465c13f8713dab67ce9596cb6eb866a6d09b3;p=thirdparty%2Fpublic-inbox.git www: disable leak detector in existing code paths At the moment, nothing else in our test suite appears to be leaking due the lack of leftover $TMPDIR/pi-leak-* files after running `make check-run'. So don't waste resources checking for leaks in codepaths which aren't affected by known Perl bugs. PublicInbox::Leak remains available in tree for future use should we need it. --- diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm index 5ccd48e42..3e9b33a37 100644 --- a/lib/PublicInbox/ExtMsg.pm +++ b/lib/PublicInbox/ExtMsg.pm @@ -13,7 +13,6 @@ use PublicInbox::WwwStream qw(html_oneshot); use PublicInbox::Smsg; our $MIN_PARTIAL_LEN = 14; # for 'XXXXXXXXXX.fsf' msgids gnus generates use B qw(cstring); -use PublicInbox::Leak; # TODO: user-configurable our @EXT_URL = map { ascii_html($_) } ( @@ -146,7 +145,6 @@ sub partial_prepare ($@) { $ctx->{again} = \@try_ibxish; sub { $ctx->{-wcb} = $_[0]; # HTTP server write callback - push @{$ctx->{-leak}}, noleak; partial_enter $ctx; } } @@ -179,7 +177,6 @@ sub ext_msg { lc 'publicinbox.nameIsUrl'} ? ($ctx->{env}) : (); ext_msg_ALL($ctx) // sub { $ctx->{-wcb} = $_[0]; # HTTP server write callback - push @{$ctx->{-leak}}, noleak; if ($ctx->{env}->{'pi-httpd.app'}) { require PublicInbox::ConfigIter; diff --git a/lib/PublicInbox/GzipFilter.pm b/lib/PublicInbox/GzipFilter.pm index 753bf95da..386f7b6b3 100644 --- a/lib/PublicInbox/GzipFilter.pm +++ b/lib/PublicInbox/GzipFilter.pm @@ -22,7 +22,6 @@ use PublicInbox::CompressNoop; use PublicInbox::Eml; use PublicInbox::GitAsyncCat; use Carp qw(carp); -use PublicInbox::Leak; our @EXPORT_OK = qw(gzf_maybe); # Compress::Raw::Zlib uses MAX_MEM_LEVEL (9) while zlib DEF_MEM_LEVEL is 8; @@ -59,7 +58,6 @@ sub psgi_response { $http->{forward} = $self; sub { my ($wcb) = @_; # -httpd provided write callback - push @{$self->{-leak}}, noleak; $self->{wcb_args} = [ $code, $res_hdr, $wcb ]; $self->can('async_next')->($http); # start stepping }; diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm index 0b04d5ed4..64a11cab1 100644 --- a/lib/PublicInbox/Qspawn.pm +++ b/lib/PublicInbox/Qspawn.pm @@ -34,7 +34,6 @@ use PublicInbox::Aspawn qw(run_await); use PublicInbox::Syscall qw(EPOLLIN); use PublicInbox::InputStream; use Carp qw(carp confess); -use PublicInbox::Leak; # n.b.: we get EAGAIN with public-inbox-httpd, and EINTR on other PSGI servers use Errno qw(EAGAIN EINTR); @@ -282,7 +281,6 @@ sub psgi_yield { # PublicInbox::HTTP, the chunked_wcb or identity_wcb callback), # but other HTTP servers are supported: $env->{'qspawn.wcb'} = $_[0]; - push @{$env->{'pi-httpd.leak'}}, noleak; start($self, $limiter, \&_yield_start); } } diff --git a/lib/PublicInbox/RepoSnapshot.pm b/lib/PublicInbox/RepoSnapshot.pm index ab8c4d587..bff97bc82 100644 --- a/lib/PublicInbox/RepoSnapshot.pm +++ b/lib/PublicInbox/RepoSnapshot.pm @@ -7,7 +7,6 @@ use v5.12; use PublicInbox::Qspawn; use PublicInbox::ViewVCS; use PublicInbox::WwwStatic qw(r); -use PublicInbox::Leak; # Not using standard mime types since the compressed tarballs are # special or do not match my /etc/mime.types. Choose what gitweb @@ -79,7 +78,6 @@ sub srv { @{$ctx->{-try}} = @try; sub { $ctx->{env}->{'qspawn.wcb'} = $_[0]; - push @{$ctx->{-leak}}, noleak; PublicInbox::ViewVCS::do_check_async($ctx, \&ver_check, @try); } } diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index b105329c5..91b3908ad 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -24,7 +24,6 @@ use POSIX qw(strftime); use Time::Local qw(timegm); use PublicInbox::Smsg qw(subject_normalized); use PublicInbox::ContentHash qw(content_hash); -use PublicInbox::Leak; use constant COLS => 72; use constant INDENT => ' '; use constant TCHILD => '` '; @@ -1363,7 +1362,6 @@ sub diff_msg { $mid, ">\n\n"; sub { $ctx->attach($_[0]->([200, delete $ctx->{-res_hdr}])); - push @{$ctx->{-leak}}, noleak; $md->begin_mail_diff; }; } diff --git a/lib/PublicInbox/WwwAttach.pm b/lib/PublicInbox/WwwAttach.pm index 38b3e3b0a..f93f32b05 100644 --- a/lib/PublicInbox/WwwAttach.pm +++ b/lib/PublicInbox/WwwAttach.pm @@ -8,7 +8,6 @@ use v5.10.1; use parent qw(PublicInbox::GzipFilter); use PublicInbox::Hval qw(psgi_base_url); use PublicInbox::Eml; -use PublicInbox::Leak; sub referer_match ($) { my ($ctx) = @_; @@ -94,7 +93,6 @@ sub get_attach ($$$) { if ($ctx->{smsg} = $ctx->{ibx}->smsg_by_mid($ctx->{mid})) { return sub { # public-inbox-httpd-only $ctx->{wcb} = $_[0]; - push @{$ctx->{-leak}}, noleak; scan_attach($ctx); } if $ctx->{env}->{'pi-httpd.app'}; # generic PSGI: diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm index dd76b49e1..fa3c4acf5 100644 --- a/lib/PublicInbox/WwwCoderepo.pm +++ b/lib/PublicInbox/WwwCoderepo.pm @@ -24,7 +24,6 @@ use PublicInbox::OnDestroy; use URI::Escape qw(uri_escape_utf8); use autodie qw(fcntl open); use PublicInbox::Git qw(git_exe); -use PublicInbox::Leak; my @EACH_REF = (git_exe, qw(for-each-ref --sort=-creatordate), "--format=%(HEAD)%00".join('%00', map { "%($_)" } @@ -238,7 +237,6 @@ sub set_readme { # git->cat_async callback sub summary ($$) { my ($ctx, $wcb) = @_; - push @{$ctx->{-leak}}, noleak; $ctx->{-wcb} = $wcb; # PublicInbox::HTTP::{Identity,Chunked} my $tip = $ctx->{qp}->{h}; # same as cgit if (defined $tip && $tip eq '') { diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 4655495d3..c9c9338ca 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -12,7 +12,6 @@ use PublicInbox::ConfigIter; use PublicInbox::WwwStream; use URI::Escape qw(uri_escape_utf8); use PublicInbox::MID qw(mid_escape); -use PublicInbox::Leak; sub ibx_entry { my ($ctx, $ibx, $ce) = @_; @@ -157,7 +156,6 @@ sub response { \&list_match_i, $re, $ctx); sub { $ctx->{-wcb} = $_[0]; # HTTP server callback - push @{$ctx->{-leak}}, noleak; $ctx->{env}->{'pi-httpd.app'} ? $iter->event_step : $iter->each_section; }