Open jjb opened 8 years ago
@ioquatix @tarcieri thoughts?
I have ran into this too. My workaround was to rescue Celluloid::DeadActorError
and kill the process myself. systemd
would start it back up for me. Otherwise you would end up in an endless loop of "Actor crashed".
@eterry1388 Thank you so much for chiming in. Could you provide some example code showing your technique?
It's more of a hack than a solution. Here is some code:
require 'celluloid/dns'
class TestServer < Celluloid::DNS::Server
def process( name, resource_class, transaction )
@resolver ||= Celluloid::DNS::Resolver.new( [[:udp, '8.8.8.8', 53], [:tcp, '8.8.8.8', 53]] )
transaction.passthrough!( @resolver )
rescue Celluloid::DeadActorError => e
puts 'Hit exception! Celluloid::DeadActorError. Killing process...'
puts name
puts e
puts e.backtrace
`killall -9 ruby`
end
end
server = TestServer.new( listen: [[:udp, '0.0.0.0', 53]] )
server.run
sleep
After reading this again, it looks like he was using rubydns
rather than celluloid-dns
. Should I open a new bug for my issue?
@eterry1388 I am He. rubydns is implemented with celluloid-dns and I thinks share the identical problem.
Sorry guys I missed all this for some reason. I'll take a look.
Given this code:
and this query:
This error happens:
The actors are permanently crashed, but the error isn't raised up to the main ruby process, so that process continues on, but is unable to process additional requests.
Is there a way to have crashed actors result in an exception raised to the outer process?
I'm using rubydns, but I figure this is a celluloid-dns problem. Let me know if that's not the case.