Hello.
I have a property change script that works perfectly fine almost all of the time.
However, once in a while, the script starts to spawn off other scripting threads, and, it also never stops.
Here is the thread of the original script that perspective calls, usually this script takes a second or two at most to execute:
Thread [script-invoke-async] id=2461, (WAITING for java.util.concurrent.CompletableFuture$Signaller@50691877)
java.base@17.0.9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.9/java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.base@17.0.9/java.util.concurrent.CompletableFuture$Signaller.block(Unknown Source)
java.base@17.0.9/java.util.concurrent.ForkJoinPool.unmanagedBlock(Unknown Source)
java.base@17.0.9/java.util.concurrent.ForkJoinPool.managedBlock(Unknown Source)
java.base@17.0.9/java.util.concurrent.CompletableFuture.waitingGet(Unknown Source)
java.base@17.0.9/java.util.concurrent.CompletableFuture.get(Unknown Source)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.getOnQueue(PropertyTreeScriptWrapper.java:153)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.blockingRead(PropertyTreeScriptWrapper.java:125)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.blockingRead(PropertyTreeScriptWrapper.java:121)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.__finditem__(PropertyTreeScriptWrapper.java:306)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.__findattr_ex__(PropertyTreeScriptWrapper.java:318)
app//org.python.core.PyObject.__getattr__(PyObject.java:957)
org.python.pycode._pyx2831.getTableRepeaterInstancesV2$1(<custom-method getTableRepeaterInstancesV2>:92)
org.python.pycode._pyx2831.call_function(<custom-method getTableRepeaterInstancesV2>)
app//org.python.core.PyTableCode.call(PyTableCode.java:173)
app//org.python.core.PyBaseCode.call(PyBaseCode.java:134)
app//org.python.core.PyFunction.__call__(PyFunction.java:416)
app//org.python.core.PyMethod.__call__(PyMethod.java:126)
org.python.pycode._pyx2767.oneShot$3(<function:valueChanged>:43)
org.python.pycode._pyx2767.call_function(<function:valueChanged>)
app//org.python.core.PyTableCode.call(PyTableCode.java:173)
app//org.python.core.PyBaseCode.call(PyBaseCode.java:306)
app//org.python.core.PyFunction.function___call__(PyFunction.java:474)
app//org.python.core.PyFunction.__call__(PyFunction.java:469)
app//org.python.core.PyFunction.__call__(PyFunction.java:464)
app//com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:847)
app//com.inductiveautomation.ignition.gateway.script.GatewaySystemUtilities.lambda$_invokeAsyncImpl$0(GatewaySystemUtilities.java:152)
app//com.inductiveautomation.ignition.gateway.script.GatewaySystemUtilities$$Lambda$5313/0x00007fa4c5738000.run(Unknown Source)
java.base@17.0.9/java.lang.Thread.run(Unknown Source)
Here is a thread dump over another 'running script' that seems to spawn off whenever this situation occurs:
Thread [perspective-worker-499] id=2573, (WAITING for java.util.concurrent.CompletableFuture$Signaller@61a61c32)
java.base@17.0.9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.9/java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.base@17.0.9/java.util.concurrent.CompletableFuture$Signaller.block(Unknown Source)
java.base@17.0.9/java.util.concurrent.ForkJoinPool.unmanagedBlock(Unknown Source)
java.base@17.0.9/java.util.concurrent.ForkJoinPool.managedBlock(Unknown Source)
java.base@17.0.9/java.util.concurrent.CompletableFuture.waitingGet(Unknown Source)
java.base@17.0.9/java.util.concurrent.CompletableFuture.get(Unknown Source)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.getOnQueue(PropertyTreeScriptWrapper.java:153)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.blockingRead(PropertyTreeScriptWrapper.java:125)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.blockingRead(PropertyTreeScriptWrapper.java:121)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.__finditem__(PropertyTreeScriptWrapper.java:306)
com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper.__findattr_ex__(PropertyTreeScriptWrapper.java:318)
app//org.python.core.PyObject.__getattr__(PyObject.java:957)
org.python.pycode._pyx2716.transform$1(<transform>:8)
org.python.pycode._pyx2716.call_function(<transform>)
app//org.python.core.PyTableCode.call(PyTableCode.java:173)
app//org.python.core.PyBaseCode.call(PyBaseCode.java:306)
app//org.python.core.PyFunction.function___call__(PyFunction.java:474)
app//org.python.core.PyFunction.__call__(PyFunction.java:469)
app//org.python.core.PyFunction.__call__(PyFunction.java:464)
app//com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:847)
app//com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:829)
app//com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:868)
com.inductiveautomation.perspective.gateway.binding.transforms.script.ScriptTransform.runFunction(ScriptTransform.java:118)
com.inductiveautomation.perspective.gateway.binding.transforms.script.ScriptTransform.synchronousTransformInternal(ScriptTransform.java:162)
com.inductiveautomation.perspective.gateway.binding.transforms.AbstractSynchronousTransform.transform(AbstractSynchronousTransform.java:30)
com.inductiveautomation.perspective.gateway.model.AbstractBindingHarness$TransformSequencer.transform(AbstractBindingHarness.java:295)
com.inductiveautomation.perspective.gateway.model.AbstractBindingHarness$TransformSequencer.run(AbstractBindingHarness.java:308)
java.base@17.0.9/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.base@17.0.9/java.util.concurrent.FutureTask.run(Unknown Source)
java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
com.inductiveautomation.perspective.gateway.threading.BlockingWork$BlockingWorkRunnable.run(BlockingWork.java:58)
java.base@17.0.9/java.lang.Thread.run(Unknown Source)
When it is all said and done, I end up with an unresponsive gateway full of running scripts with no description:
The only running script that has a description is my one originating from my property change script. I only see this problem occur when I'm working in my view that contains said property change script.
What might be causing Ignition to spawn so many scripts from my original one? What is causing this script to not finish when normally it takes a second or two? It just seems like it is locking up and then making a bunch of other scripting threads randomly.
ign01.dev.control.nglepws.com_thread_dump20240612-105718.json (550.5 KB)
ign01.dev.control.nglepws.com_thread_dump20240612-103911.json (563.4 KB)
ign01.dev.control.nglepws.com_thread_dump20240612-133224.json (1.3 MB)
ign01.dev.control.nglepws.com_thread_dump20240612-110235.json (1.6 MB)
I copied the entire thread dumps from when this is happening. I'm guessing it could be from every thread saying "WAITING for java.util.concurrent.CompletableFuture$Signaller@50691877"