diff options
author | Eric Wong <e@80x24.org> | 2016-03-05 05:44:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-03-05 05:44:16 +0000 |
commit | efdca7b8e80e74501d14eb0bee74f78309db287b (patch) | |
tree | e0db0611dd0575f18fae1756cfa4c5a6cd87d11a /lib/PublicInbox/Daemon.pm | |
parent | 5186d1f71d83ad84104c93da6bd27908a1610403 (diff) | |
download | public-inbox-efdca7b8e80e74501d14eb0bee74f78309db287b.tar.gz |
We do not want to be accepting connections during graceful shutdown because another new process is likely taking over. This also allows us to free up the listener case another (independent) process wants to claim it.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r-- | lib/PublicInbox/Daemon.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index f0be034c..c3199cd2 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -137,6 +137,7 @@ sub worker_quit () { # killing again terminates immediately: exit unless @listeners; + $_->close foreach @listeners; # call Danga::Socket::close @listeners = (); # give slow clients 30s to finish reading/writing whatever @@ -401,7 +402,9 @@ sub daemon_loop ($$) { $SIG{USR1} = *reopen_logs; $SIG{HUP} = $refresh; # this calls epoll_create: - PublicInbox::Listener->new($_, $post_accept) for @listeners; + @listeners = map { + PublicInbox::Listener->new($_, $post_accept) + } @listeners; Danga::Socket->EventLoop; $parent_pipe = undef; } |