JRuby exit hangs on ChannelStream.finalize
------------------------------------------

                 Key: JRUBY-4838
                 URL: http://jira.codehaus.org/browse/JRUBY-4838
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.5
         Environment: OSX 10.6.3
jruby 1.6.0.dev (ruby 1.8.7 patchlevel 249) (2010-05-28 2bf18ff) (Java 
HotSpot(TM) Client VM 1.6.0_20) [i386-java]

            Reporter: Nick Sieger


When a JRuby process starts a TCPServer that may be in the middle of reading, 
it hangs even if the server is a daemon thread. See the following example 
script and thread dump for details.

http://gist.github.com/420062

Inspiration for the script came from Spork and Cucumber's DRb runner.

The following patch fixes the issue, but I'm not sure if it's safe:

{noformat}
diff --git a/src/org/jruby/util/io/ChannelStream.java 
b/src/org/jruby/util/io/ChannelStream.java
index 293ad31..3d51a39 100644
--- a/src/org/jruby/util/io/ChannelStream.java
+++ b/src/org/jruby/util/io/ChannelStream.java
@@ -1139,7 +1139,7 @@ public class ChannelStream implements Stream, Finalizable 
{
      * Ensure close (especially flush) when we're finished with.
      */
     @Override
-    public synchronized void finalize() {
+    public void finalize() {
         if (closedExplicitly) return;
 
         if (DEBUG) {

{noformat}

-- 
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


Reply via email to