about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-09-12 06:54:28 +0000
committerEric Wong <e@80x24.org>2019-09-12 06:56:04 +0000
commite14d0bb916b0a2d2e8ad482e0fe892a9a0de1871 (patch)
tree11d9acc02bf6c262fd6b2c1016a81669b8118d83
parent819eba8e79e703f593a0310ee9cda57cbb9bbd0d (diff)
downloadpublic-inbox-e14d0bb916b0a2d2e8ad482e0fe892a9a0de1871.tar.gz
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".
-rw-r--r--lib/PublicInbox/SolverGit.pm2
1 files changed, 1 insertions, 1 deletions
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 {