Re: Clean termination of remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push))
- From
Sverre Rabbelier <srabbelier@gmail.com>
- Date
- Aug 31, 2011, 13:25 UTC
- Message-ID
- <CAGdFq_gSpFm8D1qHs5smUgsqyZXRjw73QFCCkBjTi0n4pwzmHA@mail.gmail.com>
- In-Reply-To
- <vpqd3flzrow.fsf_-_@bauges.imag.fr>
Heya,
On Wed, Aug 31, 2011 at 14:33, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
> I was expecting this part to be more controversial, so I'm just > repeating it to draw more attention ;-).
Eek! :)
Show 8 quoted lines
> # Inform Git that we're done, otherwise Git won't close it's stdin,
> # and the next loop will be infinite.
> close(STDOUT);
> # Flush stdin before we terminate. If we don't, git fetch
> # (transport-helper.c's sendline function) will try to write to our
> # stdin, which may be closed, and git fetch will be killed. That's
> # probably a bug in transport-helper.c, but in the meantime ...
> while (<STDIN>) {};Is this caused by you not reading the terminating '\n' that git sends when all commands are done? We previously didn't do this for imports (we couldn't, hence the new import/done behavior), so perhaps you just need to fix that? It's entirely possible you've found a bug though.
-- Cheers, Sverre Rabbelier