com.onresolve.scriptrunner.runner.ScriptRunnerImpl

JIRA | Jeff Turner | 2 years ago
  1. 0

    {panel:title=*This issue has moved*} {color:red}This issue has been moved permanently to [Adaptavist's Product Support JIRA instance|https://productsupport.adaptavist.com/browse/GRV-722].{color} All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the [Can't access your account|https://productsupport.adaptavist.com/secure/ForgotLoginDetails.jspa] link in order to reset to a new password. {panel}Hi, It seems like recent (>5.0.7) versions of the plugin have some sort of global lock in ScriptRunnerImpl.groovy:436. This is causing deadlocks where a Groovy script (a workflow post-function) indirectly invokes another Groovy script (a script field). In my case, I have a canned script post-function, invoking a Unix process which does HTTP REST calls to a JIRA. This triggers rendering of a Groovy script field, which just hangs. Here is the stacktrace of the caller (the post-function): {code} "ajp-bio-10.10.55.50-8009-exec-217953" daemon prio=10 tid=0x00007f2b4402b000 nid=0x6116 in Object.wait() [0x00007f2cc951b000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000007e8157df8> (a java.lang.UNIXProcess) at java.lang.Object.wait(Object.java:503) at java.lang.UNIXProcess.waitFor(UNIXProcess.java:263) - locked <0x00000007e8157df8> (a java.lang.UNIXProcess) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:230) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:114) at attachPO.run(attachPO.groovy:25) at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:589) at groovy.util.GroovyScriptEngine$run$1.call(Unknown Source) at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runScript(ScriptRunnerImpl.groovy:437) - locked <0x0000000763cb3de0> (a com.onresolve.scriptrunner.runner.ScriptRunnerImpl) at com.onresolve.scriptrunner.runner.ScriptRunner$runScript$3.callCurrent(Unknown Source) at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runFileAsScript(ScriptRunnerImpl.groovy:184) at com.onresolve.scriptrunner.runner.ScriptRunner$runFileAsScript$1.call(Unknown Source) at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate.doScript(CustomScriptDelegate.groovy:47) at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate$doScript.call(Unknown Source) at com.onresolve.scriptrunner.canned.jira.workflow.conditions.CustomScriptCondition.doScript(CustomScriptCondition.groovy:20) at com.onresolve.scriptrunner.canned.CannedScript$doScript.call(Unknown Source) at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.validateAndRunCannedInternal(ScriptRunnerImpl.groovy:412) at sun.reflect.GeneratedMethodAccessor23062.invoke(Unknown Source) ... {code} and of the script field that is hanging: {code} "ajp-bio-10.10.55.50-8009-exec-217965" daemon prio=10 tid=0x00007f2b4400a000 nid=0x613e waiting for monitor entry [0x00007f2cf8c14000] java.lang.Thread.State: BLOCKED (on object monitor) at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runScript(ScriptRunnerImpl.groovy:436) - waiting to lock <0x0000000763cb3de0> (a com.onresolve.scriptrunner.runner.ScriptRunnerImpl) at com.onresolve.scriptrunner.runner.ScriptRunner$runScript$3.callCurrent(Unknown Source) at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runFileAsScript(ScriptRunnerImpl.groovy:184) at com.onresolve.scriptrunner.runner.ScriptRunner$runFileAsScript$1.call(Unknown Source) at com.onresolve.scriptrunner.customfield.GroovyCustomField.getValueFromIssue(GroovyCustomField.groovy:144) at com.atlassian.jira.issue.fields.CustomFieldImpl.getJsonFromIssue(CustomFieldImpl.java:2436) at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.getFieldValue(IssueBeanBuilder.java:275) at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.addFields(IssueBeanBuilder.java:195) at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.build(IssueBeanBuilder.java:116) at com.atlassian.jira.rest.v2.issue.IssueResource.getIssue(IssueResource.java:442) at sun.reflect.GeneratedMethodAccessor2254.invoke(Unknown Source) ..... {code} I don't have the source or I'd keep digging. Is the lock at ScriptRunnerImpl.groovy:436 intentional? Thanks, Jeff

    JIRA | 2 years ago | Jeff Turner
    com.onresolve.scriptrunner.runner.ScriptRunnerImpl

    Root Cause Analysis

    1. com.onresolve.scriptrunner.runner.ScriptRunnerImpl

      No message provided

      at com.onresolve.scriptrunner.runner.ScriptRunner$runScript$3.callCurrent()
    2. com.onresolve.scriptrunner
      GroovyCustomField.getValueFromIssue
      1. com.onresolve.scriptrunner.runner.ScriptRunner$runScript$3.callCurrent(Unknown Source)
      2. com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runFileAsScript(ScriptRunnerImpl.groovy:184)
      3. com.onresolve.scriptrunner.runner.ScriptRunner$runFileAsScript$1.call(Unknown Source)
      4. com.onresolve.scriptrunner.customfield.GroovyCustomField.getValueFromIssue(GroovyCustomField.groovy:144)
      4 frames
    3. com.atlassian.jira
      IssueResource.getIssue
      1. com.atlassian.jira.issue.fields.CustomFieldImpl.getJsonFromIssue(CustomFieldImpl.java:2436)
      2. com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.getFieldValue(IssueBeanBuilder.java:275)
      3. com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.addFields(IssueBeanBuilder.java:195)
      4. com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.build(IssueBeanBuilder.java:116)
      5. com.atlassian.jira.rest.v2.issue.IssueResource.getIssue(IssueResource.java:442)
      5 frames
    4. Java RT
      GeneratedMethodAccessor2254.invoke
      1. sun.reflect.GeneratedMethodAccessor2254.invoke(Unknown Source)
      1 frame