Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.1RC2
-
Fix Version/s: None
-
Component/s: Core Classes/Modules, Extensions
-
Labels:None
-
Environment:Windows XP
-
Testcase included:yes
Description
The Stomp gem uses TCPSocket#gets inside a thread for synchronous reads, and writes to the socket using TCPSocket#puts. With the current NIO refactoring, this causes the sending thread to block. The attached test (test_duplex_socket.rb) shows it timing out after 5 seconds.
I tried immediately turning off blocking in RubyTCPSocket.java, which caused the test to pass. However, it knocked out open-uri for reading over HTTP, so that doesn't look like the solution.
Both test cases pass under MRI.
Confirmed....MRI does these reads as non-blocking, waiting for the IO to become readable via a select. In our case, I would have expected that having separate native threads would serve the same purposes, but it appears that the blocking on gets interferes with the puts calls. Researching a bit.