Issue2592
Created on 2017-05-17.08:11:36 by psterdale, last changed 2018-03-23.20:52:54 by jeff.allen.
File name |
Uploaded |
Description |
Edit |
Remove |
socket_threadpool_issue.zip
|
psterdale,
2017-05-17.11:57:08
|
Sample python script , java code and logs |
|
|
msg11374 (view) |
Author: Parisa (psterdale) |
Date: 2017-05-17.08:11:35 |
|
sys.cleanup() in org.python.util.PythonInterpreter.close() method closing thread pool _socket.NIO_GROUP in _socket.py
Is thread pool needs to be recreated create_connection() function in _socket.py if it is shutdown?
or Can we use org.python.util.PythonInterpreter instance without closing ? repeatedly shared across multiple threads?
Please suggest...
Thank you.
|
msg11375 (view) |
Author: Parisa (psterdale) |
Date: 2017-05-17.11:57:08 |
|
I have added below lines of code to create_connection() function in _socket.py
if NIO_GROUP.isShutdown():
log.debug("Theard pool is shutdown. Recreating...")
global NIO_GROUP
NIO_GROUP = NioEventLoopGroup(_NUM_THREADS, DaemonThreadFactory("Jython-Netty-Client-%s"))
sys.registerCloser(_shutdown_threadpool)
Please suggest if there is any better way to handle this...
PFA sample java code and script to reproduce the issue.
Also logs from _socket.py before and after fix.
|
msg11382 (view) |
Author: Jim Baker (zyasoft) |
Date: 2017-05-19.02:58:45 |
|
Interesting. I didn't consider lifecycle issues of PySystemState/PythonIntepreter and how it interacts with such Netty threadpools. Something like this could be the right answer, possibly on a per PySystemState to avoid causing ClassLoaders for Jython to not GC. In general we would prefer to avoid have such global singletons, convenient as they may have been for perhaps the most common case.
|
msg11731 (view) |
Author: Jeff Allen (jeff.allen) |
Date: 2018-03-01.07:32:13 |
|
Are we content to let 2.7.2 go out with Netty lifecycle issues (which seem to be an issue generally #2517, #2584)? It's a bit shabby, but (to me) not quick to fix.
|
|
Date |
User |
Action |
Args |
2018-03-23 20:52:54 | jeff.allen | set | priority: normal milestone: Jython 2.7.2 -> |
2018-03-01 07:32:14 | jeff.allen | set | nosy:
+ jeff.allen messages:
+ msg11731 |
2017-06-08 18:28:30 | zyasoft | set | milestone: Jython 2.7.1 -> Jython 2.7.2 |
2017-05-19 02:58:45 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg11382 |
2017-05-17 11:57:09 | psterdale | set | files:
+ socket_threadpool_issue.zip messages:
+ msg11375 |
2017-05-17 08:11:37 | psterdale | create | |
|