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

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

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 24, 2010, 19:24 UTC
Message-ID
<201008242124.23890.j6t@kdbg.org>
In-Reply-To
<AANLkTimk+SsmiHk7zWCTEeghk3sYjapDCDeZX=TP9UH_@mail.gmail.com>
On Montag, 23. August 2010, Erik Faye-Lund wrote:
Show 12 quoted lines
> - The culprit seems to be our poll-emulation. My understanding is that
> poll() was called by create_pack_file() in upload-pack.c with nfds=1
> (it's 2 until one of the fds are closed) when there's no data
> available in the pipe. Since our poll() always returns POLLIN when
> nfds=1, the check for xread(...) == 0 further down in
> create_pack_file() cause the fd to be closed, leading to an error on
> the client-side.
> -  Just removing the nfds=1-hack works for me, but I'm suspecting the
> nfds=1-hack is there for some socket-reason. So instead I've replaced
> our poll-emulation with gnulib's in my branch (with a couple of
> patches on top), and it seems to do the trick for me. I still haven't
> tested it heavily, though.

The nfds == 1 hack is an "optimization": When only one channel must be observed, then we can let (x)read() wait for data instead of doing it inside poll() in some way.

I'm not happy with our poll emulation because it contains a busy-loop. Gnulib's version looks quite capable, but I haven't studied it in detail. Until then, I trust that it does the right thing.

--Hannes
Previous: Erik Faye-LundNext: Erik Faye-Lund
Message 8 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.