Hello Ludo,
May 8, 2025, 22:34 by l...@gnu.org:

> Hello,
>
> So I think my last attempt was misguided; attached is a simpler
> reproducer that exhibits the problem following these steps:
>
>  1. create a socket, bind it, and mark it as O_NONBLOCK;
>  2. select on that socket to wait for an incoming connection;
>  3. clear its O_NONBLOCK flag;
>  4. call accept, which returns a connected socket;
>  5. notice that O_NONBLOCK is set on that new socket (it shouldn’t).
>
> I believe the problem is that the connection is made why the original
> socket is marked O_NONBLOCK, and pflocal’s ‘S_socket_connect’ inherits
> that O_NONBLOCK flag in the socket it gets via ‘sock_clone’.  The test
> program later clears O_NONBLOCK but it has no effect since in pflocal
> the connected socket has already been created with O_NONBLOCK and queued.
>
> The patch below fixes that (and thus fixes the Shepherd socket
> activation, as yelninei initially reported).
>
> Thoughts?
>
> Ludo’.
>
I tested your patch and it solves the issue for all the test cases I had, in 
particular guix-daemon works instantly again.

Thank you for looking into it.


Reply via email to