From e5a1fbcf502750d898c5a213a7ece701bba44299 Mon Sep 17 00:00:00 2001 From: Adam Markowski Date: Mon, 9 Dec 2024 16:30:01 +0100 Subject: [PATCH 1/3] Update reporting about shutting down --- lib/eventboss/launcher.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/eventboss/launcher.rb b/lib/eventboss/launcher.rb index 2a12c3c..592dfc0 100644 --- a/lib/eventboss/launcher.rb +++ b/lib/eventboss/launcher.rb @@ -29,7 +29,7 @@ def start end def stop - logger.info('launcher') { 'Gracefully shutdown' } + logger.info('launcher') { 'Starting shutdown' } @bus.clear @pollers.each(&:terminate) @@ -85,6 +85,8 @@ def wait_for_shutdown sleep shutdown_delay logger.info('launcher') { "Waiting for #{@pollers.size} pollers, #{@workers.size} workers" } end + + logger.info('launcher') { 'Gracefully shutdown' } end def shutdown_attempts From 4d60e9a15dd7e5dc6e3ec87d54c3b7d0d434f7dc Mon Sep 17 00:00:00 2001 From: Adam Markowski Date: Tue, 10 Dec 2024 15:41:21 +0100 Subject: [PATCH 2/3] add condition to log about gracefully shutdown --- lib/eventboss/launcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eventboss/launcher.rb b/lib/eventboss/launcher.rb index 592dfc0..30349ee 100644 --- a/lib/eventboss/launcher.rb +++ b/lib/eventboss/launcher.rb @@ -86,7 +86,7 @@ def wait_for_shutdown logger.info('launcher') { "Waiting for #{@pollers.size} pollers, #{@workers.size} workers" } end - logger.info('launcher') { 'Gracefully shutdown' } + logger.info('launcher') { 'Gracefully shutdown' } if @pollers.empty? && @workers.empty? end def shutdown_attempts From 3697e165bc18ed8041e1b7f9f124960b419c17a4 Mon Sep 17 00:00:00 2001 From: Adam Markowski Date: Wed, 11 Dec 2024 09:13:44 +0100 Subject: [PATCH 3/3] CR remarks --- lib/eventboss/launcher.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/eventboss/launcher.rb b/lib/eventboss/launcher.rb index 30349ee..424f308 100644 --- a/lib/eventboss/launcher.rb +++ b/lib/eventboss/launcher.rb @@ -41,7 +41,10 @@ def stop end def hard_shutdown - return if @pollers.empty? && @workers.empty? + if @poolers.empty? && @workers.empty? + logger.info('launcher') { 'Gracefully shutdown' } + return + end logger.info('launcher') { "Killing remaining #{@pollers.size} pollers, #{@workers.size} workers" } @pollers.each(&:kill) @@ -85,8 +88,6 @@ def wait_for_shutdown sleep shutdown_delay logger.info('launcher') { "Waiting for #{@pollers.size} pollers, #{@workers.size} workers" } end - - logger.info('launcher') { 'Gracefully shutdown' } if @pollers.empty? && @workers.empty? end def shutdown_attempts