From: Eric Wong Date: 2012-03-17T09:24:17+09:00 Subject: [ruby-core:43361] Re: [ruby-trunk - Bug #6154] Eliminate extending WaitReadable/Writable at runtime Charles Nutter wrote: > I should have mentioned that JRuby has been running this way for a > while (on master) and we have had no reports of incompatibility. The > concrete subclass is_a EAGAIN and is_a WaitReadable, so all typical > exception-handling patterns work correctly. Good to know. I like this change[1] > The only cases that break are cases that check e.class == EAGAIN, > which is probably not a good pattern anyway. I also noticed some test failures with your patch. (But I think the minor incompatibility is acceptable for 2.0.0) test_read_nonblock(OpenSSL::TestPair) [$top_srcdir/test/openssl/test_pair.rb:145]: [OpenSSL::SSL::SSLError] exception expected, not Class: Message: <"read would block"> ---Backtrace--- $top_srcdir/trunk/.ext/common/openssl/buffering.rb:174:in `sysread_nonblock' $top_srcdir/trunk/.ext/common/openssl/buffering.rb:174:in `read_nonblock' $top_srcdir/test/openssl/test_pair.rb:147:in `block (2 levels) in test_read_nonblock' --------------- test_dgram_pair(TestSocket_UNIXSocket) [$top_srcdir/test/socket/test_unix.rb:348]: [Errno::EAGAIN] exception expected, not Class: Message: <"Resource temporarily unavailable - recvfrom(2) would block"> ---Backtrace--- $top_srcdir/test/socket/test_unix.rb:348:in `recv_nonblock' $top_srcdir/test/socket/test_unix.rb:348:in `block in test_dgram_pair' --------------- [1] I'd like an exception-avoiding API more, though :)