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

Re: [PATCH 3/3] Add sideband status report to git-archive protocol

From
Junio C Hamano <junkio@cox.net>
Date
Sep 12, 2006, 23:44 UTC
Message-ID
<7vhczcejlf.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<45066CFD.5040202@innova-card.com>
Franck Bui-Huu <vagabon.xyz@gmail.com> writes:
Show 15 quoted lines
>> I was uncomfortable letting waitpid() there to wait forever.
>> When does poll() return?  (1) we have data ready in which case
>> we process; (2) the child somehow closed the pipe but without
>> dying, which is an error in the child.  In the latter case even
>> not hanging in waitpid() and retrying the poll would not give
>> any useful input so that would not help either.
>
> your case (2) is not totaly right. If you look a the trace above,
> for the normal case, you can see that the child close the pipe then 
> _after_ a while die. So there's a time when the child is not died
> but the pipe is closed.
>
> I think it's safe to assume that if the child closes the pipe, either
> because it has finished to write or something wrong going on, then
> it's going to die pretty soon. 

I am essentially saying the same thing (and perhaps one more). Something is wrong with the child, and either it's going to die pretty soon in which case waitpid() to wait forever is fine, or even if it is not going to die soon, going back to poll() would not give us any useful information anyway, so WNOHANG was pointless.

So we are in agreement.
> I think calling send_sideband() with sz = 0 should be fine,

I just coded it defensively -- no point calling send() when you already know there is nothing to be sent.

Previous: Franck Bui-HuuNext: Rene Scharfe
Message 24 of 28 in “archive: allow remote to have more formats than we understand.”
  1. 1/2 archive: allow remote to have more formats than we understand.Junio C Hamano, Sep 10, 2006
  2. 2/2 Add --verbose to git-archiveJunio C Hamano, Sep 10, 2006
  3. 1/3 Move sideband client side support into reusable form.Junio C Hamano, Sep 10, 2006
  4. Franck Bui-HuuSep 10, 2006
  5. Move sideband server side support into reusable form.Junio C Hamano, Sep 10, 2006
  6. 3/3 Add sideband status report to git-archive protocolJunio C Hamano, Sep 10, 2006
  7. git-upload-archive: add config option to allow only specified formatsRene Scharfe, Sep 10, 2006
  8. Rene ScharfeSep 10, 2006
  9. Junio C HamanoSep 10, 2006
  10. Rene ScharfeSep 11, 2006
  11. Jakub NarebskiSep 11, 2006
  12. Franck Bui-HuuSep 10, 2006
  13. Rene ScharfeSep 11, 2006
  14. Franck Bui-HuuSep 10, 2006
  15. Junio C HamanoSep 10, 2006
  16. Franck Bui-HuuSep 11, 2006
  17. Junio C HamanoSep 12, 2006
  18. Franck Bui-HuuSep 12, 2006
  19. Franck Bui-HuuSep 12, 2006
  20. connect.c: finish_connect(): allow null pid parameterFranck Bui-Huu, Sep 12, 2006
  21. Junio C HamanoSep 13, 2006
  22. Test return value of finish_connect()Franck Bui-Huu, Sep 13, 2006
  23. git_connect: change return type to pid_tFranck Bui-Huu, Sep 13, 2006
  24. Junio C HamanoSep 12, 2006
  25. Rene ScharfeSep 10, 2006
  26. Franck Bui-HuuSep 10, 2006
  27. Junio C HamanoSep 10, 2006
  28. Franck Bui-HuuSep 10, 2006

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.