]> Sergey Matveev's repositories - public-inbox.git/commitdiff
daemon: be less misleading about graceful shutdown
authorEric Wong <e@80x24.org>
Sat, 18 Jun 2016 10:51:37 +0000 (10:51 +0000)
committerEric Wong <e@80x24.org>
Sat, 18 Jun 2016 21:48:34 +0000 (21:48 +0000)
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.

lib/PublicInbox/Daemon.pm
lib/PublicInbox/HTTPD/Async.pm

index b76b9ffbf91ac944518aa72d43ed43bcde618174..a25dd90fa407e81ac1a430474ee4779d7563c5d5 100644 (file)
@@ -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
index fadf2d3abb9aaf6fe63f7c27cf5e68f567a318ab..a936d9b5a0c6fc5e3988c88085437a1322b13333 100644 (file)
@@ -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;