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

Re: [PATCH 1/2] daemon: use timeout for uninterruptible poll

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2018, 22:16 UTC
Message-ID
<xmqqvacsyv1y.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqq36zw16gv.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
> I think you identified the problem and diagnosed it correctly, but I
> find that the change proposed here introduces a severe layering
> violation.  The code is still calling what is called poll(), which
> should not have such a broken semantics.

I only mentioned a piece of fact (i.e. "the code calls poll() after the patch"), but I guess I should have made it clear what makes that a bad thing. Future readers of the code in daemon.c are required to be aware of the limitation of some poll() emulation; they cannot "optimize" out and made the code unware of the (non-)existence of remaining children, for example. When the callsite uses poll(), those who know how poll() ought to work won't be. The reason why the xpoll() I mentioned as a possible alternative would be better is because they will learn why we do not use normal poll() there and why we maintain and pass live_children (and those who cut and paste without understanding the existing code _will_ copy the calling site of xpoll(), which will automatically copy the need to maintain the number of remaining children ;-).

Previous: Junio C HamanoNext: Johannes Schindelin
Message 7 of 15 in “Fix early EOF with GfW daemon”
  1. 0/2 Fix early EOF with GfW daemonKim Gybels, Apr 12, 2018
  2. 1/2 daemon: use timeout for uninterruptible pollKim Gybels, Apr 12, 2018
  3. Johannes SchindelinApr 13, 2018
  4. Kim GybelsApr 15, 2018
  5. Johannes SchindelinApr 18, 2018
  6. Junio C HamanoApr 15, 2018
  7. Junio C HamanoApr 15, 2018
  8. Johannes SchindelinApr 18, 2018
  9. Junio C HamanoApr 18, 2018
  10. Kim GybelsApr 19, 2018
  11. Junio C HamanoApr 19, 2018
  12. 2/2 daemon: graceful shutdown of client connectionKim Gybels, Apr 12, 2018
  13. Johannes SchindelinApr 13, 2018
  14. Kim GybelsApr 15, 2018
  15. Johannes SchindelinApr 18, 2018

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.