]> Sergey Matveev's repositories - public-inbox.git/commit
daemon: avoid race when quitting workers
authorEric Wong <e@80x24.org>
Sun, 24 Nov 2019 00:22:30 +0000 (00:22 +0000)
committerEric Wong <e@80x24.org>
Sun, 24 Nov 2019 21:35:19 +0000 (21:35 +0000)
commit8576a48b2344905229737fde45498c80a1171ca5
tree0ff343124cd1498415babfd8b74efc827c56b6c7
parent34a51e5736d7d1b7d2da7f7640eb2b87eec121ff
daemon: avoid race when quitting workers

While the master process has a self-pipe to avoid missing
signals, worker processes lack that aside from a pipe to
detect master death.

That pipe doesn't exist when there's no master process,
so it's possible DS::close never finishes because it
never woke up from epoll_wait.  So create a pipe on
the worker_quit signal and force it into epoll/kevent
so it wakes up right away.
lib/PublicInbox/Daemon.pm