Script console might be producing performance issues

Article ID:360041827211
1 minute readKnowledge base

Issue

  • Your instance is running into performance isssues and Handling POST /script appears in the slow-requests directory inside the support bundle.

Handling POST /script from X.X.233.86 : qtp2085857771-25823200 / waiting for OperationsCenter2 connection from X.X.3.131/X.X.6.135:41400 id=45711894" Id=25823200 TIMED_WAITING on hudson.remoting.UserRequest@6a31aa89
 	at java.lang.Object.wait(Native Method)
 	-  waiting on hudson.remoting.UserRequest@6a31aa89
 	at hudson.remoting.Request.call(Request.java:177)
 	at hudson.remoting.Channel.call(Channel.java:954)
 	at hudson.remoting.VirtualChannel$call$6.call(Unknown Source)
 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
 	at Script1$_run_closure2.doCall(Script1.groovy:171)
 	...

 11703msec elapsed in Handling POST /script from X.X.199.86 : qtp2085857771-25823200 / waiting for OperationsCenter2 connection from X.X.3.131/X.X.6.130:41400 id=45711894
     java.lang.Object.wait(Native Method)
     hudson.remoting.Request.call(Request.java:177)
     hudson.remoting.Channel.call(Channel.java:954)
     hudson.remoting.VirtualChannel$call$6.call(Unknown Source)
     org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
     org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
     org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
     Script1$_run_closure2.doCall(Script1.groovy:171)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     java.lang.reflect.Method.invoke(Method.java:498)

Resolution

The performance issue you are facing might be produced by an administrator executing a Groovy script under Manage Jenkins -> Script Console. Before moving into a different hypotesis, it is suggested capturing thread dumps next time the issue is exposed and ensure that there is not any /script request into the threads. You can execute thread dumps by following the KB article Required Data: Jenkins: High CPU On Linux - specifically through the script collectPerformanceData.sh.

If you would like to disable the access to $JENKINS_URL/script then you could use the CloudBees Request Filter Plugin.