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@gmail.com>
Date
Aug 25, 2010, 17:40 UTC
Message-ID
<AANLkTinboi+L3fvC___pULO0u_ZBNNOM6er+chxt7s07@mail.gmail.com>
In-Reply-To
<201008242124.23890.j6t@kdbg.org>
On Tue, Aug 24, 2010 at 9:24 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 18 quoted lines
> On Montag, 23. August 2010, Erik Faye-Lund wrote:
>> - 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.
>

OK, thanks for the clarification. Unfortunately, this optimization breaks down in some cases (like the one I described).

> 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.
>

Well, I've found (and supplied patches for) a couple of bugs in it, but apart from that it seems quite sane. So yeah, I think it might be the best way forward.

But I'm curious, what's the best way of import a couple of foreign source files, while maintaining a couple of patches on top of them? I'm thinking that perhaps a import-commit followed by the patches would make it easier to merge in changes than to just import the patched version, but I'm not entirely sure how to do such a merge without merging a full subtree...

Previous: Johannes SixtNext: Johannes Sixt
Message 9 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.