From e14d0bb916b0a2d2e8ad482e0fe892a9a0de1871 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 12 Sep 2019 06:54:28 +0000 Subject: solvergit: don't drop update-index stdin with qspawn 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 { -- cgit v1.2.3-24-ge0c7