about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/yahns/server.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb
index 9eb5378..2b0af03 100644
--- a/lib/yahns/server.rb
+++ b/lib/yahns/server.rb
@@ -378,9 +378,16 @@ class Yahns::Server # :nodoc:
   end
 
   def quit_enter(alive)
-    @logger.info "#{alive ? "grace" : "force"}fully exiting"
+    if alive
+      @logger.info("gracefully exiting shutdown_timeout=#{@shutdown_timeout} s")
+    else # drop connections immediately if signaled twice
+      @logger.info("graceful exit aborted, exiting immediately")
+      # we will still call any app-defined at_exit hooks here
+      # use SIGKILL if you don't want that.
+      exit(0)
+    end
+
     drop_acceptors # stop acceptors, we close epolls in quit_done
-    exit(0) unless alive # drop connections immediately if signaled twice
     @config.config_listeners.each_value do |opts|
       list= opts[:yahns_app_ctx_list] or next
       # Yahns::HttpContext#persistent_connections=