Gateway Message Handlers

I have a couple of message handler scripts that I am using throughout my project (in vision components and in tags using “runscript”).

These scripts will run fine for extended periods of time (like for weeks), but then randomly my system.util.sendRequest to those scripts stop working. All that requires to get them back working again is to change anything on the gateway events and save the project…

Anyone has any insight on what might be happening here?

Any errors show in the wrapper log?

I get this error:

… in valueChanged at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities$RequestImpl.checkTimeout(SystemUtilities.java:1104) at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities$RequestImpl.internalWait(SystemUtilities.java:1137) at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities$RequestImpl.block(SystemUtilities.java:1205) at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities$RequestImpl.get(SystemUtilities.java:1211) at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities.sendRequest(SystemUtilities.java:840) at jdk.internal.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.util.concurrent.TimeoutException: java.util.concurrent.TimeoutException: Timeout has expired for sendRequest operation

That suggests the script is stuck in an infinite loop or otherwise stuck incomplete. Which I think will pause further processing.

Any suggestions for troubleshooting what might be causing this? I’ll have the script running for weeks and one random day I’ll come in and its stuck.

Look at everything the script does that a) can loop, or b) access external resources. Either can yield unbounded delays.

Add logging within the script that reports start, reaching critical points, and finish. When the problem occurs, look at the logging to identify the problem section. Then add finer-grained logging in that section.

1 Like