Closed rtyler closed 10 years ago
Can you post your test code? I have exit handling working without a problem in JRuby and MRI.
Status: Closed Ref: Core Ruby 2+ functionality, not a gem bug.
The Ruby team seems unlikely to revert this behavior to 1.x levels. Additional discussions:
http://bugs.ruby-lang.org/issues/7917 http://bugs.ruby-lang.org/issues/7648 https://github.com/celluloid/celluloid-io/issues/66
One suggested work around for simplistic cases:
client = Stomp::Client.new(....)
#
# Additional logic ....
#
Signal.trap(:INT) { # Alternatively Kernel.trap
puts "Stopping... 1"
ct = Thread.new do # close in a different thread
client.close
end
ct.join
puts "Stopping... 2"
exit 0 # Perhaps.
}
This issue was reported by a coworker, who was seeing the following exception:
Basically, if a
Stomp::Client
is instructued to close in a signal handler (SIGINT/SIGTERM) the following exception can be raised, and won't cleanly terminate the Client