git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [msysGit] upload-pack timing issue on windows?

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Feb 8, 2010, 11:18 UTC
Message-ID
<40aa078e1002080318n16918f91r5a5f4cd9b76a8436@mail.gmail.com>
In-Reply-To
<201002062318.59180.j6t@kdbg.org>
On Sat, Feb 6, 2010 at 11:18 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 25 quoted lines
> On Samstag, 6. Februar 2010, Erik Faye-Lund wrote:
>> However, I have tracked down a bit of what goes on in the client.
>> There's a call to read_in_full, called from pack-write.c, line 246
>> that fails in the failure-case, but not in the success-case. This is
>> where the client expects "pack\tSHA-1" or "keep\tSHA-1". There "fatal:
>> early EOF"-messages seems to originate from index-pack.c, line 197.
>> This is the first line of code in parse_pack_header(), it's also
>> AFAICT the first call-site for any read(0, <...>) (though fill()).
>
> This looks like upload-pack died without sending enough to fill a pack header.
>
> Try merging this branch:
>
>  git://repo.or.cz/git/mingw/j6t.git async-in-thread
>
> It contains your changes to start_async plus a refinement of die() when it is
> called from the async procedure (it passes t5530, for example). It is also
> converted to pthreads, and therefore also works on Unix. The new
> implementation of start_async is more careful about the file handles, though
> not so much on Windows.
>
> If there's no change for you, then you could look into implementing
> fcntl(F_GETFD/SETFD, FD_CLOEXEC), which are currently ignored, on top of this
> branch, using Get/SetHandleInformation().
>

Thanks a lot. I tried merging it, but the issue still pops up. I also tried to implement fcntl(F_GETFD/SETFD, FD_CLOEXEC), still no dice. I'm not entirely sure if I did it correctly, though.

Show 10 quoted lines
> Background: On Unix, we need FD_CLOEXEC so that the fds that are meant for the
> async thread do not remain open in an unrelated child process; on Windows, we
> are just lucky and can get away without FD_CLOEXEC because our pipe()s are
> non-inheritable and async only work with pipes. But once we pass other fds to
> the async procedure, we need a working FD_CLOEXEC. Perhaps something in this
> direction is related to your problem.
>
> You could push out your current state of the git-daemon and a recipe to
> reproduce the problem. Perhaps I find some time to look into it.
>

Sure. You can find my current version at git://repo.or.cz/git/kusma.git work/daemon-fcntl

This branch includes your branch and my fcntl-attempt, as well as an almost-fixed-up version of the last daemon-win32 series I sent out (still lacking critical sections when saving process ids, as you suggested).

-- 
Erik "kusma" Faye-Lund
Previous: Johannes SixtNext: Jay Soffian
Message 5 of 11 in “upload-pack timing issue on windows?”
  1. Erik Faye-LundFeb 5, 2010
  2. Johannes SixtFeb 6, 2010
  3. Erik Faye-LundFeb 6, 2010
  4. Johannes SixtFeb 6, 2010
  5. Erik Faye-LundFeb 8, 2010
  6. Jay SoffianFeb 10, 2010
  7. Erik Faye-LundAug 22, 2010
  8. Johannes SixtAug 24, 2010
  9. Erik Faye-LundAug 25, 2010
  10. Johannes SixtAug 25, 2010
  11. Erik Faye-LundAug 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.