UDT requires Restart Tag

I am having trouble with a UDT with several instances. The UDT has three tags with Value Changed scripts, one of which writes activity to a database. They work well for a while and randomly, with no errors in the gateway log, it stops logging. If I "Restart Tag" on the tag and /or "Restart Tag" on the folder, it/they take off and run as expected. I have seen previous posts back when 8.0 was rolled out with stale tags. Is this still a known issue? Is there any recommendations for me to resolve this?

Ignition version 8.1.27.

Take a Gateway thread dump next time this happens and then call support.

https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Threads#DiagnosticsThreads-IndividualThreads

@Kevin.Herron thank you. I will do this.
One question, sometimes we don't catch it immediately... With that being the case, is there a length of time that is too long in terms of when the UDT stops recording and when we get a thread dump that makes the thread dump useless in troubleshooting? If so, we want to be sure to capture a relevant thread dump.
Thanks,

Maybe. Depends on what the problem is, so I can't answer that for sure.

One potential problem is that SQL queries to some databases can hang indefinitely because of poor default timeout values. If that's what's happening I suspect we'll see it in the thread dumps after any amount of time.

You really should not be writing directly to any database from a tag's valueChange script. Use the store-and-forward system to decouple your script from any database-generated delays. Some related discussions about the knife edge you are perched upon:

https://forum.inductiveautomation.com/search?q=tag%20event%20single%20digit%20milliseconds

@pturmel I will look into this as a solution- thank you.
Technically, the tag is calling a project script feeding in a few variables.

Doesn't matter--still ties up the tag event thread, which is one of a limited thread pool.