Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/async/container/supervisor/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Copy link
Contributor Author

@macournoyer macournoyer Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is the most important, or else any error will silently stop the Fiber here: https://github.com/socketry/io-endpoint/blob/main/lib/io/endpoint/wrapper.rb#L169, and potentially exit the accept loop.

ensure
connection.close
remove(connection)
Expand Down
Loading