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 80AFB1F463 for ; Thu, 12 Sep 2019 06:58:40 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] solvergit: don't drop update-index stdin with qspawn Date: Thu, 12 Sep 2019 06:58:40 +0000 Message-Id: <20190912065840.6538-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's possible for Qspawn callers to be deferred, in which case we must ensure we don't cause the temporary file used for stdin to become unref-ed and closed. This can be a problem when we exceed the default Qspawn limiter of 32 concurrent processes for "git update-index". --- lib/PublicInbox/SolverGit.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index 58869ffb..49f94895 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -241,7 +241,7 @@ sub prepare_index ($) { sysseek($in, 0, 0) or die "seek: $!"; dbg($self, 'preparing index'); - my $rdr = { 0 => fileno($in) }; + my $rdr = { 0 => fileno($in), -hold => $in }; my $cmd = [ qw(git update-index -z --index-info) ]; my $qsp = PublicInbox::Qspawn->new($cmd, $self->{git_env}, $rdr); $qsp->psgi_qx($self->{psgi_env}, undef, sub { -- 2.22.0.rc1.1.g3e0570f6ac