]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
www: disable leak detector in existing code paths
authorEric Wong <e@80x24.org>
Wed, 17 Dec 2025 23:39:15 +0000 (23:39 +0000)
committerEric Wong <e@80x24.org>
Fri, 19 Dec 2025 21:51:34 +0000 (21:51 +0000)
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.

lib/PublicInbox/ExtMsg.pm
lib/PublicInbox/GzipFilter.pm
lib/PublicInbox/Qspawn.pm
lib/PublicInbox/RepoSnapshot.pm
lib/PublicInbox/View.pm
lib/PublicInbox/WwwAttach.pm
lib/PublicInbox/WwwCoderepo.pm
lib/PublicInbox/WwwListing.pm

index 5ccd48e42d7717c828e897e77c3b6343f67ef9d1..3e9b33a37aa330c7f420c00ea3d45af2934872a4 100644 (file)
@@ -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;
index 753bf95da727142231c92387f425495b00ad9084..386f7b6b3f8b446ff08a12f86037287e8b226033 100644 (file)
@@ -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
                };
index 0b04d5ed4ad34f26c88ad22824fb8ac1ddd44fd1..64a11cab12970459d33daeb69cd443a7b8165b25 100644 (file)
@@ -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);
        }
 }
index ab8c4d587a43c59c5d01b86c8940eb80b7633405..bff97bc82b2ae5a508309351bad173fda20c1164 100644 (file)
@@ -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);
        }
 }
index b105329c57c1b0da42ddfff516da6d6eb26a34c9..91b3908adb1a850dac4f4ea689283959887e5ddf 100644 (file)
@@ -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, "</a>&gt;\n\n";
        sub {
                $ctx->attach($_[0]->([200, delete $ctx->{-res_hdr}]));
-               push @{$ctx->{-leak}}, noleak;
                $md->begin_mail_diff;
        };
 }
index 38b3e3b0a4ed7e3e59e87b94ba3deab0a28acbad..f93f32b05b0fee85b9837673b5290c04dce39b5a 100644 (file)
@@ -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:
index dd76b49e168d32dba8bbb5b9bdd1c305d27b84d1..fa3c4acf5876a2964b2907b3b264cd127b52206d 100644 (file)
@@ -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 '') {
index 4655495d33adf6622622bb61b1593483eac65a18..c9c9338ca2d43d12fedf421137d5af0912b08627 100644 (file)
@@ -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;
                }