From: Eric Wong Date: Sat, 18 Jun 2016 10:51:37 +0000 (+0000) Subject: daemon: be less misleading about graceful shutdown X-Git-Tag: v1.0.0~413 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26d8524281b1461a3a7e4a19f0db3180228f2877;p=thirdparty%2Fpublic-inbox.git daemon: be less misleading about graceful shutdown We do not need to count the httpd.async object against our running client count, that is tied to the socket of the actual client. This prevents misleading sysadmins about connected clients during shutdown. --- diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index b76b9ffbf..a25dd90fa 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -180,7 +180,8 @@ sub worker_quit { my $n = 0; foreach my $s (values %$dmap) { - if ($s->can('busy') && $s->busy) { + $s->can('busy') or next; + if ($s->busy) { ++$n; } else { # close as much as possible, early as possible diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm index fadf2d3ab..a936d9b5a 100644 --- a/lib/PublicInbox/HTTPD/Async.pm +++ b/lib/PublicInbox/HTTPD/Async.pm @@ -74,7 +74,4 @@ sub close { PublicInbox::EvCleanup::asap($cleanup) if $cleanup; } -# do not let ourselves be closed during graceful termination -sub busy () { $_[0]->{cb} } - 1;