Issue2170
Created on 2014-06-21.09:49:41 by matsk, last changed 2014-06-23.21:16:36 by zyasoft.
msg8779 (view) |
Author: Mats Karlsson (matsk) |
Date: 2014-06-21.09:49:40 |
|
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
|
msg8781 (view) |
Author: Mats Karlsson (matsk) |
Date: 2014-06-22.03:16:24 |
|
Have the same problem with jython version 2.7b2.
$ java -cp jython-standalone-2.7-b1.jar org.python.util.jython
>>> import contextlib, urllib2
>>> u = 'http://www.google.com/notfound'
>>> with contextlib.closing(urllib2.urlopen(u)) as x:
>>> print x.read()
|
msg8806 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-06-23.18:02:09 |
|
The underlying socket implementation was "rebooted" recently in Jython 2.7. I just tried your test against trunk and didn't see CLOSE_WAIT sockets on either OS X 10.9 or Ubuntu 14.04.
Please see if this works for you in the same fashion.
|
msg8810 (view) |
Author: Mats Karlsson (matsk) |
Date: 2014-06-23.18:40:18 |
|
I have now tried with trunk and the problem seems to be solved.
All good, many thanks.
You can close this bug.
|
msg8812 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-06-23.21:16:36 |
|
Thanks, glad we have fixed this in the reboot
|
|
Date |
User |
Action |
Args |
2014-06-23 21:16:36 | zyasoft | set | status: open -> closed messages:
+ msg8812 |
2014-06-23 18:40:18 | matsk | set | messages:
+ msg8810 |
2014-06-23 18:02:09 | zyasoft | set | resolution: works for me messages:
+ msg8806 nosy:
+ zyasoft |
2014-06-22 03:16:25 | matsk | set | messages:
+ msg8781 |
2014-06-21 09:49:41 | matsk | create | |
|