Message8779

Author matsk
Recipients matsk
Date 2014-06-21.09:49:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403344181.77.0.507666862811.issue2170@psf.upfronthosting.co.za>
In-reply-to
Content
Jython leaking file descriptors. Sockets ends up in CLOSE_WAIT and then never gets garbage collected. 

To reproduce:
If you run the jython CLI in one shell and then look at the socket states in another, you can see that they ends up in CLOSE_WAIT forever.
The same problem occurs when using org.python.util.PythonInterpreter. 

 $ java -cp jython-standalone-2.5.3.jar org.python.util.jython
 >>> import urllib2
 >>> urllib2.urlopen('http://www.google.com/notfound')
 >>> urllib2.urlopen('http://www.google.com/notfound')
 >>> urllib2.urlopen('http://www.google.com/notfound')
 >>> urllib2.urlopen('http://www.google.com/notfound')
 >>> urllib2.urlopen('http://www.google.com/notfound')

To check sockets:

 $ netstat -ant|grep CLOSE
History
Date User Action Args
2014-06-21 09:49:41matsksetrecipients: + matsk
2014-06-21 09:49:41matsksetmessageid: <1403344181.77.0.507666862811.issue2170@psf.upfronthosting.co.za>
2014-06-21 09:49:41matsklinkissue2170 messages
2014-06-21 09:49:41matskcreate