Can't break a thread by raising exception from main thread if there is
"readline" in thread
-------------------------------------------------------------------------------------------
Key: JRUBY-5723
URL: http://jira.codehaus.org/browse/JRUBY-5723
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.6.1
Environment: jruby-1.6.1, ubuntu 10.10, 64-bit
Reporter: Dilshod Mukhtarov
Attachments: test-jruby-readline-exception.rb
Hi,
Normally, I can raise exception in some thread from main/other thread by
some_thread.raise() and then rescue it in that above mentioned thread. This is
useful when we need to break execution of some_thread on some event.
In jruby there is a problem if some_thread have readline method and waiting for
input. It stucks in readline until it receives \n.
This works ok under ruby-mri (both 1.8.7 and 1.9.2).
For example, I want to close from another thread some connection threads in
GServer's implementation on some events. That connection threads are stuck in
waiting input (readline) and can't close connection until io timeout.
I applied a test file, which you can run under jruby (and you will see that
it's stuck and you have to press ENTER to exit) and ruby-mri where it exits
automatically.
Regards,
Dilshod
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email