From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C3A681F803 for ; Tue, 8 Jan 2019 18:37:49 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] do not shutdown until listeners are all stopped Date: Tue, 8 Jan 2019 18:37:49 +0000 Message-Id: <20190108183749.2938-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Otherwise, listeners may still be injecting into the queue and new clients may be accepted. Fixes: 86ea6ed1417b ("server: respect shutdown_timeout") --- lib/yahns/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb index c078ade..d13c57e 100644 --- a/lib/yahns/server.rb +++ b/lib/yahns/server.rb @@ -500,7 +500,7 @@ def dropping(fdmap) if drop_acceptors[0] || fdmap.size > 0 timeout = @shutdown_expire < Yahns.now ? -1 : @shutdown_timeout n = fdmap.desperate_expire(timeout) - return false if n == 0 # all done! + return false if n == 0 && @listeners.empty? # all done! # FIXME: sometimes shutdowns take a long time when using proxy_pass # Still not sure what's going on and it takes a while to reproduce.. -- EW