Closed rjattrill closed 9 years ago
@kenichi this type of exit handler should probably be put back, but not just used for profiling:
https://github.com/kenichi/angelo/blob/master/lib/angelo.rb#L140
The error shown has to do with somehow disrupting nio4r
... possibly due to not properly shutting down the reactor. But, with jruby, you cannot trap INT
or any other kill-like signal directly.
Do something like:
at_exit { #de vs. trap signal {}
Celluloid.shutdown
sleep 2
}
@rjattrill thanks for the report. i see this using plain reel too, both 0.5.0 and 0.6.0-milestone, so i kind of feel that it's not an angelo bug?
@digitalextremist thanks... i tried adding the at_exit to no avail. do you also see this with a plain reel server?
@kenichi I've actually seen this before, now that I think about it. What happens, if it is what I think it is, is definitely on a Reel
level also, and I'll look for it. What it is, I think, is that the server loop is sitting in socket.accept
which is blocking until a connection. When the socket is taken away ( while being listened to ) it crashes the listener. Lately I've been doing different types of server loops, but often times the best thing you can do is catch the exception, test for shutdown conditions, and mute the output. A lot of times with Celluloid
lately, it's so loud upon exit that once I've done all sensitive storage, etc.. I just mute the error output in general, but that's only until Celluloid
becomes better about shutdown.
@digitalextremist do you have some examples of what you're saying? my attempts at "quieting" celluloid usually make it "louder" :)
@kenichi have you tried proper cheating?
def suppressed(&block)
_ = Celluloid.logger.dup
Celluloid.logger = ::Logger.new("/dev/null")
return unless block_given?
yield
Celluloid.logger = _
end
closing in favor of a fix in reel - reopen if determined to be an angelo issue.
I also see this in plain Reel. I can't see any open issue so will open one and reference here.
@kenichi which fix are you reffering to? @rjattrill's fix does not fix this :( at least not for me.
Issuing a Ctrl+C to shutdown the server results in a stack dump.
Environment details:
Crash message: