From 98002908a98ece5f975b7b19ee1d7b6dbb323492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Cournoyer?= Date: Thu, 16 Oct 2025 13:41:24 -0400 Subject: [PATCH] Rescue errors in Supervisor server. --- lib/async/container/supervisor/server.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/async/container/supervisor/server.rb b/lib/async/container/supervisor/server.rb index 81591e5..b9cafb4 100644 --- a/lib/async/container/supervisor/server.rb +++ b/lib/async/container/supervisor/server.rb @@ -46,12 +46,18 @@ def do_restart(call) # We are going to terminate the progress group, including *this* process, so finish the current RPC before that: call.finish - ::Process.kill(signal, ::Process.ppid) + begin + ::Process.kill(signal, ::Process.ppid) + rescue => error + Console.error(self, "Error while sending #{signal} to process!", signal: signal, exception: error) + end end def do_status(call) @monitors.each do |monitor| monitor.status(call) + rescue => error + Console.error(self, "Error while getting status!", monitor: monitor, exception: error) end call.finish @@ -80,6 +86,8 @@ def run(parent: Task.current) @endpoint.accept do |peer| connection = Connection.new(peer, 1) connection.run(self) + rescue => error + Console.error(self, "Error while accepting connection!", exception: error) ensure connection.close remove(connection)