Closed carlhoerberg closed 5 years ago
OpenSSL::SSL::SSLError
is a descendant of StandardError and the loop handles Exception
, which is the base exception class StandardError
is a descendant of.
I don't see where Bunny sets Thread#abort_on_exception
for the reader loop thread. Consumer work pool has a setting for that.
@carlhoerberg I guess what I'm saying is, I don't see why the exception would not be caught by t he existing code. Bunny does not set Thread#abort_on_exception
for the I/O loop thread. I'd accept a PR that makes this an optional feature that defaults to false
but this would be a workaround. We don't really know what the root cause is.
Doh, the very first line says you globally set Thread.abort_on_exception
. Bunny should not be concerned with such global settings; their users should understand the risks: exceptions will bee propagated to the main thread.
I found no way to "out out of" the global Thread.abort_on_exception = true
without subclassing Thread
since in Ruby, Thread.new
begins callable execution immediately:
Thread.abort_on_exception = true
t = Thread.new { raise "oops" }
t.abort_on_exception = false
does not opt the thread out. Moreover,
t = Thread.new { sleep 5; raise "oops" }
t.abort_on_exception = false
Thread.abort_on_exception = true
suggests that the class flag overrides any previously set Thread
instance values.
Subclassing Thread
is way out of scope for Bunny.
Yeah, let's ignore abort_on_exception
and fix the root cause instead.
Opened the issue late last night, didn't even look at the code, just opened the issue to remember it in the morning. Submitted a PR for it now. Sorry for causing confusion with Thread.abort_on_exception
.
2.14.3
is out.
While connected over AMQPS, and
Thread.abort_on_exception = true
, I sometimes get this, and the whole apps crashes:Can we make this more graceful? Worst case just set
Thread.current.abort_on_exception = false
in the reader_loop thread?