[JIRA] (JENKINS-59706) Threads blocked in /blue/rest/organizations/jenkins/computers/ due to loop in PipelineRunImpl.getCommitUrl

14 views
Skip to first unread message

jglick@cloudbees.com (JIRA)

unread,
Oct 8, 2019, 12:08:02 PM10/8/19
to jenkinsc...@googlegroups.com
Jesse Glick created an issue
 
Jenkins / Bug JENKINS-59706
Threads blocked in /blue/rest/organizations/jenkins/computers/ due to loop in PipelineRunImpl.getCommitUrl
Issue Type: Bug Bug
Assignee: Unassigned
Components: blueocean-plugin
Created: 2019-10-08 16:07
Labels: lazy-loading performance
Priority: Critical Critical
Reporter: Jesse Glick

ci.jenkins.io froze, and Daniel Beck found that hundreds of threads were blocked in

"Handling GET /blue/rest/organizations/jenkins/computers/ from ... : ..." #... prio=5 os_prio=0 cpu=9992.49ms elapsed=2517.82s tid=... nid=... waiting for monitor entry  [...]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:370)
	- waiting to lock <...> (a hudson.model.RunMap)
	at jenkins.model.lazy.LazyBuildMixIn.getBuildByNumber(LazyBuildMixIn.java:228)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.getBuildByNumber(WorkflowJob.java:232)
	at io.jenkins.blueocean.rest.impl.pipeline.PipelineRunImpl.getCommitUrl(PipelineRunImpl.java:197)
	at java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(java...@11.0.4/DirectMethodHandle$Holder)
	at java.lang.invoke.LambdaForm$MH/....invoke(java...@11.0.4/LambdaForm$MH)
	at java.lang.invoke.LambdaForm$MH/....invoke_MT(java...@11.0.4/LambdaForm$MH)
	at io.jenkins.blueocean.commons.stapler.export.MethodProperty.getValue(MethodProperty.java:72)
	at io.jenkins.blueocean.commons.stapler.export.ExportInterceptor$1.getValue(ExportInterceptor.java:46)
	at io.jenkins.blueocean.commons.stapler.Export$BlueOceanExportInterceptor.getValue(Export.java:196)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeTo(Property.java:136)
	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:228)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:303)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:169)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeTo(Property.java:154)
	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:228)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:303)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeBuffered(Property.java:175)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:235)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:169)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeTo(Property.java:154)
	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:228)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:303)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeBuffered(Property.java:175)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:219)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:169)
	at io.jenkins.blueocean.commons.stapler.export.Property.writeTo(Property.java:154)
	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:228)
	at io.jenkins.blueocean.commons.stapler.export.Model.writeTo(Model.java:199)
	at io.jenkins.blueocean.commons.stapler.Export.writeOne(Export.java:177)
	at io.jenkins.blueocean.commons.stapler.Export.serveExposedBean(Export.java:168)
	at io.jenkins.blueocean.commons.stapler.Export.doJson(Export.java:108)
	at io.jenkins.blueocean.commons.stapler.TreeResponse$Processor$1.generateResponse(TreeResponse.java:48)
	at ...

Looking at the code, this seems like a classic lazy-loading violation: looping over possibly every historical build of a job, each load of which involves expensive disk I/O. Under no circumstances may a plugin do this.

This seems to have been noted in JENKINS-56773 but the response was just to disable the blueocean-executor-info plugin. How are users who already have this plugin installed supposed to know this? Some throttling was added, but evidently not enough.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Oct 8, 2019, 12:12:02 PM10/8/19
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-59706
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Oct 8, 2019, 12:12:03 PM10/8/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Oct 8, 2019, 12:14:02 PM10/8/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 28, 2020, 7:42:05 AM1/28/20
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-59706
 
Re: Threads blocked in /blue/rest/organizations/jenkins/computers/ due to loop in PipelineRunImpl.getCommitUrl

As far as I can tell, https://github.com/jenkinsci/blueocean-plugin/releases/tag/blueocean-parent-1.21.0 includes this change. Thanks Jesse Glick for that pull request! I think this can be marked 'Closed' in release blue ocean 1.21.0

damien.coraboeuf@gmail.com (JIRA)

unread,
Apr 8, 2020, 7:40:03 AM4/8/20
to jenkinsc...@googlegroups.com
Damien Coraboeuf edited a comment on Bug JENKINS-59706
Hi,

We're using version 1.21.0 of BlueOcean on Jenkins LTS 2.204.1 and the problem persists :(

Calls to {{/blue/rest/organizations/jenkins/computers/}} are so heavy that they freeze the browsers when accessing BlueOcean. We had to disable those calls at
firewall proxy level but this makes some features of BlueOcean not working any longer (like triggering a build from the branch view).

We do have an installation with up to 125 transient EC2 nodes and thousands of jobs running every day.

What could I provide which helps fixing the issue?

Thanks,
Damien Coraboeuf
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

damien.coraboeuf@gmail.com (JIRA)

unread,
Apr 8, 2020, 7:40:03 AM4/8/20
to jenkinsc...@googlegroups.com

Hi,

We're using version 1.21.0 of BlueOcean on Jenkins LTS 2.204.1 and the problem persists

Calls to /blue/rest/organizations/jenkins/computers/ are so heavy that they freeze the browsers when accessing BlueOcean. We had to disable those calls at firewall level but this makes some features of BlueOcean not working any longer (like triggering a build from the branch view).

We do have an installation with up to 125 transient EC2 nodes and thousands of jobs running every day.

What could I provide which helps fixing the issue?

Thanks,
Damien Coraboeuf

damien.coraboeuf@gmail.com (JIRA)

unread,
Apr 8, 2020, 7:51:02 AM4/8/20
to jenkinsc...@googlegroups.com

I've now seen JENKINS-56773 and we will uninstall the "Blue Ocean Executor Info" plugin and check.

Reply all
Reply to author
Forward
0 new messages