Re: [PATCH v2 0/3] daemon: explicitly allow EINTR during poll()
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 25, 2025, 19:35 UTC
- Message-ID
- <c314cd2d-8fdd-4386-bda0-881ff87d9204@gmail.com>
- In-Reply-To
- <xmqqo6ubx00s.fsf@gitster.g>
On 25/06/2025 17:24, Junio C Hamano wrote:
Show 23 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes: > >> On 25/06/2025 08:35, Carlo Marcelo Arenas Belón via GitGitGadget wrote: >>> This series addresses and ambiguity that is at least visible in OpenBSD, >>> where zombie proceses would only be cleared after a new connection is >>> received. >> >> There is still a race where a child that exits after it has been >> checked in check_dead_children() but before we call poll() will not be >> collected until a new connection is received or a child exits while >> we're polling. If we used the self-pipe trick described on the >> select(2) man page [1] we would avoid that race and would not need to >> mess with SA_RESTART and so would not need to introduce >> USE_NON_POSIX_SIGNAL. >> >> Best Wishes >> >> Phillip >> >> [1] https://www.man7.org/linux/man-pages/man2/select.2.html > > The principle should apply equally to poll-based service loop, I > presume.
Yes, you create a pipe, add the read end to the set of file descriptors monitored by poll() and write to the other end of the pipe when a signal is received.
Thanks
Phillip
> Thanks.