]> Sergey Matveev's repositories - public-inbox.git/commitdiff
examples/*@.service: sockets MUST be NonBlocking
authorEric Wong <e@80x24.org>
Sun, 30 Jun 2019 07:11:00 +0000 (07:11 +0000)
committerEric Wong <e@80x24.org>
Sun, 30 Jun 2019 07:11:00 +0000 (07:11 +0000)
For users running multiple (-nntpd@1, -nntpd@2) instances of
either -httpd or -nntpd via systemd to implement zero-downtime
restarts; it's possible for a listen socket to become blocking
for a moment during an accept syscall and cause a daemons to
get stuck in a blocking accept() during
PublicInbox::Listener::event_step (event_read in previous
versions).

Since O_NONBLOCK is a file description flag, systemd clearing
O_NONBLOCK momentarily (before PublicInbox::Listener::new
re-enables it) creates a window for another instance of our
daemon to get stuck in accept().

cf. systemd.service(5)


No differences found