Collector debug timeout changed (Groovy scripts)
Summary: Matt Whitney reported an issue where Groovy scripts time out after 60 seconds when using the !groovy command in collector debug, although it used to run correctly previously. Rob Sapsford suggested trying a timeout option in the command, but Matt Whitney still encountered timeouts even with the adjustment. Testing in different browsers showed that using a Chrome extension allowed the script to run for the intended duration, but this workaround is not viable for Matt Whitney due to enforced use of MS Edge in their organization. Both authors confirmed that the change in behavior appears to be recent.
When using the !groovy command to run Groovy scripts in collector debug, I have noticed that recently all scripts time out after 60 seconds.
We have used the debug console extensively to develop & troubleshoot custom logicmodule scripts. We have never had a problem, until recently all scripts started timing out after 60 seconds. With error message Execute time out.
Has anybody else had this issue with timeout behavior changing in collector debug?
LM Supports recommendation was to use a browser extension, but that is not an option for us since the extension is exclusive to Chrome, and our organization enforces use of MS Edge.
Rob Sapsford
·4 months ago · EditedI haven't noticed the change but you can pass the timeout when you run the !groovy command:
$ help !groovy
Usage:
!groovy [options] scriptFilePath
!groovy [options] \nscriptbody
Options:
timeout: timeout in seconds, default 180 seconds
runner: where to run the script. Runner must be agent or sse, and agent is the default runner
hostId: send which host(in the portal) properties to groovy runner.
h: indicates which host(in the collector) the hostProps will bound to
Arguments:
scriptFilePath: specify the script path in collector side for executing
scriptbody: embedded script body from the !groovy popup window
I don't use the chrome extension. Hope this is helpful.
Matt Whitney
OP4 months agoThanks Rob, even when I use that timeout option in the !groovy command I get timeouts after 50-60 seconds.
I tested with the below groovy script and always timeout in less than 60 seconds. This script should run for exactly 3 minutes. I am curious to know if others are seeing the same issue.
// Record start time def startTime = System.currentTimeMillis() // Run for 3 minutes (180,000 milliseconds) def duration = 180000 while ((System.currentTimeMillis() - startTime) < duration) { // Sleep a bit to avoid busy-waiting sleep(1000) } // Output completion message println "Script has finished running after 3 minutes." return 0Rob Sapsford
·4 months ago · EditedWindows Collector, Edge, !groovy and !groovy timeout=180 both timeout at 60 seconds.
Windows Collector, Chrome with extension, runs for 180 seconds (I know you said you can't use this but I wanted to for comparison)
Windows Collector, Chrome WITHOUT extension, !groovy and !groovy timeout=180 both timeout at 60 seconds.
Matt Whitney
OP4 months agoThank you Rob, I appreciate you testing that. Sounds like you are seeing the same thing as me.
This behavior definitely is new, I used the debug as recently as a few months ago to develop a custom datasource which runs long.
Rob Sapsford
·4 months agoYou're welcome. I don't debug scripts that way normally, so didn't notice but yes I'm seeing what you reported.