Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner: Timeout for pre receive hooks?

wlfbck
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2022

Is it possible to put in a timeout for the scripts that will be executed if you add a "Custom pre-hook" under "Pre Hooks"?

Because i just tested it with a simple while(true) and it has been running for about 10minutes now. I would very much like to prevent this.

1 answer

1 accepted

1 vote
Answer accepted
Robert Giddings _Adaptavist_
Community Champion
April 5, 2022

Hi @wlfbck ,

Thank you for your post.

Currently you have two options with ScriptRunner for Bitbucket.

In your Scripts you could add an @TimedInterrupt annotation, as documented here: https://docs.groovy-lang.org/2.5.14/html/gapi/groovy/transform/TimedInterrupt.html

This should add a timeout to the Scripts that is added too.

If however you find yourself with a Script that appears to be running forever, currently, you would need to restart your Bitbucket instance.

This is something we are looking to improve with the product.

I hope this helps answer your question?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

wlfbck
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 5, 2022

TimedInterrupt should work, i will try that out. Thank you for the suggestion!

But from an administrators perspective i think it would be great if runtime could be limited via a general Scriptrunner setting, since something like this could happen without any intention and then just as easy go unnoticed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events