-
-
Notifications
You must be signed in to change notification settings - Fork 942
Description
Environment Information
carbon% jruby -v jruby 9.2.11.0 (2.5.7) 2020-03-02 612d7a05a6 OpenJDK 64-Bit Server VM 25.242-b08 on 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 +jit [linux-x86_64] carbon% uname -a Linux carbon 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Expected Behavior
When I wrap a Socket#connect call with Timeout#timeout, I expect the call to time out after the specified time. Test case
MRI:
carbon% ruby test.rb init connect Traceback (most recent call last): 3: from test.rb:9:in `' 2: from /home/w/.rbenv/versions/2.7.0/lib/ruby/2.7.0/timeout.rb:110:in `timeout' 1: from test.rb:11:in `block in ' test.rb:11:in `connect': execution expired (Timeout::Error)
Actual Behavior
The connect call appears to be hung indefinitely. The application can be aborted with Ctrl-C.
** Threaded Variation **
This test completes when run on MRI. The thread is aborted and the Thread#join call finishes.
On JRuby this file hangs indefinitely. The thread is stuck in aborting state. The application can be aborted with Ctrl-C.
** Thread status oscillating between aborting and run **
I don't know if this is expected, but while the thread is stuck in the aborting state, calling Thread#run on it makes it switch back into run state, and it can be moved back and forth between these two states any number of times as shown in this test. My first reaction was if I kill the thread it should die, calling run on it shouldn't negate the kill request.