aux/socket: patch scheduling bug in socket egg

It's possible for the thread to be interrupted between configuring the
timeout and the file descriptor wait. This causes a low-probability 60
second wait until the timeout expires.

Now that this is fixed, we can set a normal timeout on the socket once
again, so do that.

Link: https://github.com/ursetto/socket-egg/pull/7
This commit is contained in:
puck 2024-10-09 20:36:44 +00:00
parent fa3103ac82
commit 84207df87d
3 changed files with 24 additions and 2 deletions

View file

@ -27,7 +27,7 @@
(define *daemon*
(make-parameter
(parameterize
((socket-send-buffer-size 4096) (socket-send-size 4096) (socket-receive-timeout #f) (socket-send-timeout #f))
((socket-send-buffer-size 4096) (socket-send-size 4096) (socket-receive-timeout 5000) (socket-send-timeout 5000))
(let ((unix-socket (socket af/unix sock/stream)))
(socket-connect unix-socket (unix-address "/nix/var/nix/daemon-socket/socket"))
(let-values (((in-port out-port) (socket-i/o-ports unix-socket)))