From fa43d9b64381d27c9fe14c7d20b58611a30c774b Mon Sep 17 00:00:00 2001 From: jiikko Date: Tue, 13 Dec 2022 23:32:11 +0900 Subject: [PATCH] =?UTF-8?q?log=E3=82=92=E3=81=A8=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/procon_bypass_man/bypass/bypass_command.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/procon_bypass_man/bypass/bypass_command.rb b/lib/procon_bypass_man/bypass/bypass_command.rb index 17a5b794..7ef13ea0 100644 --- a/lib/procon_bypass_man/bypass/bypass_command.rb +++ b/lib/procon_bypass_man/bypass/bypass_command.rb @@ -53,7 +53,7 @@ def execute # シビア t2 = Thread.new do bypass = ProconBypassMan::Bypass::ProconToSwitch.new(gadget: @gadget, procon: @procon) - process = BlueGreenProcess.new(worker_instance: bypass, max_work: 550) + process = BlueGreenProcess.new(worker_instance: bypass, max_work: 1000) loop do if $will_terminate_token if $will_terminate_token == WILL_TERMINATE_TOKEN::TERMINATE @@ -89,21 +89,31 @@ def execute signal = readable_io.first[0].gets.strip handle_signal(signal) end - rescue ProconBypassMan::InterruptForRestart + rescue ProconBypassMan::InterruptForRestart # USR2を受け取ったとき + ProconBypassMan.logger.debug 'ProconBypassMan::InterruptForRestart例外を受け取りました' $will_terminate_token = WILL_TERMINATE_TOKEN::RESTART + ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行します" BlueGreenProcess.terminate_workers_immediately + ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行しました" [t1, t2].each(&:join) + ProconBypassMan.logger.debug "[t1, t2].each(&:join)を実行しました" @gadget&.close @procon&.close DRb.stop_service + ProconBypassMan.logger.debug "DRb.stop_serviceを実行しました" exit! 1 # child processなのでexitしていい - rescue Interrupt + rescue Interrupt # TERMを受け取ったとき + ProconBypassMan.logger.debug 'Interrupt例外を受け取りました' $will_terminate_token = WILL_TERMINATE_TOKEN::TERMINATE + ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行します" BlueGreenProcess.terminate_workers_immediately + ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行しました" [t1, t2].each(&:join) + ProconBypassMan.logger.debug "[t1, t2].each(&:join)を実行しました" @gadget&.close @procon&.close DRb.stop_service + ProconBypassMan.logger.debug "DRb.stop_serviceを実行しました" exit! 1 # child processなのでexitしていい end end