Issue2624

classification
Title: Deadlock with jython script engine initialization and jython object deserialization
Type: Severity: normal
Components: Core Versions: Jython 2.7
Milestone: Jython 2.7.0
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: fviale, zyasoft
Priority: Keywords:

Created on 2017-09-05.15:43:37 by fviale, last changed 2017-09-05.16:36:58 by zyasoft.

Files
File name Uploaded Description Edit Remove
jstack.Node.log fviale, 2017-09-05.15:50:43 Stuck JVM on PyScriptEngine initialization
Messages
msg11562 (view) Author: Fabien Viale (fviale) Date: 2017-09-05.15:50:43
We experience some kind of deadlock while at the same time initializing jython script engines and deserializing jython objects (org.python.core.Py$SingletonResolver.readResolve(Py.java:76)).

The main thread blocked show the following: (it's in RUNNING state but stay forever like this)
"TaskLauncher on pnps://lawetgcn021.azure01.csp.local:36217/SSH-ECS2-516_0" #147 prio=5 os_prio=0 tid=0x00007f806002a800 nid=0x1095 in Object.wait() [0x00007f81d980c000]
   java.lang.Thread.State: RUNNABLE
	at org.python.core.Py.<clinit>(Py.java:87)
	at org.python.core.Py$SingletonResolver.readResolve(Py.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1148)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2036)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
	at org.ow2.proactive.scheduler.common.util.Object2ByteConverter.convertByte2Object(Object2ByteConverter.java:70)
	at org.ow2.proactive.scheduler.common.task.util.SerializationUtil.deserializeVariableMap(SerializationUtil.java:60)
	at org.ow2.proactive.scheduler.common.task.util.SerializationUtil.deserializeVariableMap(SerializationUtil.java:48)
	at org.ow2.proactive.scheduler.task.context.TaskContextVariableExtractor.extractPreviousTaskResultVariablesFromTaskContext(TaskContextVariableExtractor.java:160)
	at org.ow2.proactive.scheduler.task.context.TaskContextVariableExtractor.extractVariables(TaskContextVariableExtractor.java:95)
	at org.ow2.proactive.scheduler.task.context.TaskContextVariableExtractor.extractVariables(TaskContextVariableExtractor.java:65)
	at org.ow2.proactive.scheduler.task.TaskLauncher.fileSelectorsFilters(TaskLauncher.java:331)
	at org.ow2.proactive.scheduler.task.TaskLauncher.doTask(TaskLauncher.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.objectweb.proactive.core.mop.MethodCall.execute(MethodCall.java:243)
	at org.objectweb.proactive.core.body.request.RequestImpl.serveInternal(RequestImpl.java:207)
	at org.objectweb.proactive.core.body.request.RequestImpl.serve(RequestImpl.java:153)
	at org.objectweb.proactive.core.body.BodyImpl$ActiveLocalBodyStrategy.serveInternal(BodyImpl.java:561)
	at org.objectweb.proactive.core.body.BodyImpl$ActiveLocalBodyStrategy.serve(BodyImpl.java:486)
	at org.objectweb.proactive.core.body.AbstractBody.serve(AbstractBody.java:417)
	at org.objectweb.proactive.Service.serve(Service.java:119)
	at org.objectweb.proactive.Service.blockingServeOldest(Service.java:203)
	at org.objectweb.proactive.Service.blockingServeOldest(Service.java:178)
	at org.objectweb.proactive.Service.fifoServing(Service.java:141)
	at org.objectweb.proactive.core.body.ActiveBody$FIFORunActive.runActivity(ActiveBody.java:329)
	at org.objectweb.proactive.core.body.ActiveBody.run(ActiveBody.java:167)
	at java.lang.Thread.run(Thread.java:748)

Other threads such as this one seems as well not evolving

"ScriptHandler on pnps://lawetgcn021.azure01.csp.local:36217/SSH-ECS2-516_2" #164 prio=5 os_prio=0 tid=0x00007f806003f000 nid=0x10a2 in Object.wait() [0x00007f81d88fe000]
   java.lang.Thread.State: RUNNABLE
	at org.python.core.PyType.init(PyType.java:544)
	at org.python.core.PyType.createType(PyType.java:1412)
	- locked <0x00000000db9cfd00> (a java.lang.Class for org.python.core.PyType)
	at org.python.core.PyType.addFromClass(PyType.java:1348)
	- locked <0x00000000db9cfd00> (a java.lang.Class for org.python.core.PyType)
	at org.python.core.PyType.fromClass(PyType.java:1439)
	- locked <0x00000000db9cfd00> (a java.lang.Class for org.python.core.PyType)
	at org.python.core.PyType.fromClass(PyType.java:1423)
	- locked <0x00000000db9cfd00> (a java.lang.Class for org.python.core.PyType)
	at org.python.core.PyStringMap.getLazyType(PyStringMap.java:66)
	at org.python.core.PyStringMap.<init>(PyStringMap.java:46)
	at org.python.core.PyStringMap.<init>(PyStringMap.java:42)
	at org.python.expose.BaseTypeBuilder.getDict(BaseTypeBuilder.java:48)
	at org.python.core.PyType.init(PyType.java:532)
	at org.python.core.PyType.addBuilder(PyType.java:1338)
	- locked <0x00000000db9cfd00> (a java.lang.Class for org.python.core.PyType)
	at org.python.core.PyType.<clinit>(PyType.java)
	at org.python.core.PyObject.<init>(PyObject.java:93)
	at org.python.core.PyBuiltinCallable.<init>(PyBuiltinCallable.java:22)
	at org.python.core.PyBuiltinMethod.<init>(PyBuiltinMethod.java:16)
	at org.python.core.PyBuiltinMethodNarrow.<init>(PyBuiltinMethodNarrow.java:23)
	at org.python.core.PyDataDescr$getset_descriptor___get___exposer.<init>(Unknown Source)
	at org.python.core.PyDataDescr$PyExposer.<init>(Unknown Source)
	at org.python.core.PyDataDescr.<clinit>(PyDataDescr.java)
	at org.python.core.PyBuiltinCallable$PyExposer.<init>(Unknown Source)
	at org.python.core.PyBuiltinCallable.<clinit>(PyBuiltinCallable.java)
	at org.python.core.PyObject$PyExposer.<init>(Unknown Source)
	at org.python.core.PyObject.<clinit>(PyObject.java)
	at org.python.jsr223.PyScriptEngine.<init>(PyScriptEngine.java:27)
	at org.python.jsr223.PyScriptEngineFactory.getScriptEngine(PyScriptEngineFactory.java:85)
	at org.ow2.proactive.scripting.Script.createScriptEngine(Script.java:353)
	at org.ow2.proactive.scripting.Script.execute(Script.java:278)
	at org.ow2.proactive.scripting.ScriptHandler.handle(ScriptHandler.java:84)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.objectweb.proactive.core.mop.MethodCall.execute(MethodCall.java:243)
	at org.objectweb.proactive.core.body.request.RequestImpl.serveInternal(RequestImpl.java:207)
	at org.objectweb.proactive.core.body.request.RequestImpl.serve(RequestImpl.java:153)
	at org.objectweb.proactive.core.body.BodyImpl$ActiveLocalBodyStrategy.serveInternal(BodyImpl.java:561)
	at org.objectweb.proactive.core.body.BodyImpl$ActiveLocalBodyStrategy.serve(BodyImpl.java:486)
	at org.objectweb.proactive.core.body.AbstractBody.serve(AbstractBody.java:417)
	at org.objectweb.proactive.Service.serve(Service.java:119)
	at org.objectweb.proactive.Service.blockingServeOldest(Service.java:203)
	at org.objectweb.proactive.Service.blockingServeOldest(Service.java:178)
	at org.objectweb.proactive.Service.fifoServing(Service.java:141)
	at org.objectweb.proactive.core.body.ActiveBody$FIFORunActive.runActivity(ActiveBody.java:329)
	at org.objectweb.proactive.core.body.ActiveBody.run(ActiveBody.java:167)
	at java.lang.Thread.run(Thread.java:748)
msg11563 (view) Author: Fabien Viale (fviale) Date: 2017-09-05.15:51:48
Forgot to mention we use jython version 2.7.0
msg11564 (view) Author: Jim Baker (zyasoft) Date: 2017-09-05.16:36:58
Most likely this bug, http://bugs.jython.org/issue2609

Please try this fix and see if it works for you.
History
Date User Action Args
2017-09-05 16:36:58zyasoftsetnosy: + zyasoft
messages: + msg11564
2017-09-05 15:53:53fvialesetmilestone: Jython 2.7.0
2017-09-05 15:51:48fvialesetmessages: + msg11563
2017-09-05 15:50:45fvialesetfiles: + jstack.Node.log
messages: + msg11562
title: Deadlock in jython script engine initialization -> Deadlock with jython script engine initialization and jython object deserialization
2017-09-05 15:43:37fvialecreate