Re: [RFC] upload-pack deadlock
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 18, 2011, 05:34 UTC
- Message-ID
- <20110418053406.GA5256@elie>
- In-Reply-To
- <20110406213333.GA18481@sigill.intra.peff.net>
Jeff King wrote:
> Subject: [PATCH] upload-pack: start pack-objects before async rev-list > > In a pthread-enabled version of upload-pack, there's a race condition > that can cause a deadlock on the fflush(NULL) we call from run-command.
[...]
Show 8 quoted lines
> To fix this, we swap the start order: we start the > pack-objects reader first, and then the rev-list writer > after. Thus the problematic fflush(NULL) happens before we > even open the new file descriptor (and even if it didn't, > flushing should no longer block, as the reader at the end of > the pipe is now active). > > Signed-off-by: Jeff King <peff@peff.net>
t5500.12 "fetch same depth in shallow repo" reproducibly hangs[1] on the HURD without this patch and passes with it. I had just assumed it was some weird hurd thing. Thanks for figuring it out.
Tested-by: Jonathan Nieder <jrnieder@gmail.com>
[1] http://bugs.debian.org/607346