I’ve some troubles with my gateway timer scripts.
First of all, they all are in fixed rate and dedicated, with a delay from 1s to 10mn.
Sometime, they freeze in a strange way: in my browser on the status page for gateway scripts, everything seems fine, but in reality they are not executed (I have input/output counters for every single one). There is no error in logs.
I noticed it happens more often when one script used to synchronize databases, a pretty huge sql stored procedure which take between 10s to 45s for a delay of 2mn, is enable.
Something else: there is another project with its own scripts (fixed rate/dedicated too) and they still running normally while mine are freezing.
I executed every script in the script console to check errors, but everything seems clear.
I’m using 7.9.8.
Each and every timer script, no matter what it’s interval settings, will not execute again while a previous invocation is still running. Anything you do in your timer scripts that cannot always be executed within the event period must be sent to an asynchronous thread, unless the non-overlapping condition is desirable. Consider having each troublesome event log on start and again on finish so it is obvious how log it is taking, and a missing finish will tell you that something is getting stuck. I’ve yet to see one of these situations not be programmer error.
My issue turned out to be the script was hanging, which caused the Gateway timed task to hang, and not be able to execute again, as pturmel was saying.
Once i fixed the underlying issue with the script hanging, i had no more problems with Gateway timer scripts running regularly.
Not sure it would work. Jython threads are really java threads. They don’t like to be externally killed. They have an interrupt feature that could be used (and I recommend), but that requires the thread to regularly check its own .interupted() status. See the related advice in this topic: