[JIRA] (JENKINS-62142) Race condition during init between jobs and agent

11 views
Skip to first unread message

nigel.armstrong@braincorp.com (JIRA)

unread,
May 1, 2020, 5:14:03 PM5/1/20
to jenkinsc...@googlegroups.com
Nigel Armstrong created an issue
 
Jenkins / Bug JENKINS-62142
Race condition during init between jobs and agent
Issue Type: Bug Bug
Assignee: FABRIZIO MANFREDI
Components: branch-api-plugin, core, ec2-plugin, remoting
Created: 2020-05-01 21:13
Environment: org.jenkins-ci.main:jenkins-war:2.222.3
org.jenkins-ci.main:remoting:4.2
ec2-plugin:1.49.1
configuration-as-code:1.39
job-dsl:1.77
Priority: Major Major
Reporter: Nigel Armstrong

There appears to be a race condition between the initialization of tasks and the initialization of nodes. This appears to be within remoting, but I have included my version of ec2 plugin because we see this on ec2 agents. 

We are seeing that jobs are being deleted from nodes after a reboot. This appears to be caused by branch-api-plugin WorkspaceLocatorImpl.java (When a computer comes online check for jobs that exist on the computer but do not exist in jenkins (via getItemByFullName)). 

It seems that either branch-api-plugin needs a change to wait for jobs to be loaded or maybe jenkins should wait for jobs to be loaded before lauching nodes. 

 

As an aside the way we found this issue is that it manifests to us a a very long startup time caused by running out of heap space because large objects were allocated when connected to nodes to receive stack traces of exceptions on the nodes caused by jenkins trying to delete the folder of a job in progress that jenkins did not have permission to delete. From here I found that this was caused by the remoting plugin trying to delete the build

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

nigel.armstrong@braincorp.com (JIRA)

unread,
May 5, 2020, 1:01:06 AM5/5/20
to jenkinsc...@googlegroups.com
Nigel Armstrong updated an issue
Change By: Nigel Armstrong
Component/s: branch-api-plugin
Component/s: ec2-plugin

nigel.armstrong@braincorp.com (JIRA)

unread,
May 5, 2020, 1:01:08 AM5/5/20
to jenkinsc...@googlegroups.com
Nigel Armstrong assigned an issue to Jeff Thompson
Change By: Nigel Armstrong
Assignee: FABRIZIO MANFREDI Jeff Thompson

nigel.armstrong@braincorp.com (JIRA)

unread,
May 5, 2020, 1:04:03 AM5/5/20
to jenkinsc...@googlegroups.com
Nigel Armstrong assigned an issue to Unassigned
Change By: Nigel Armstrong
Assignee: Jeff Thompson

nigel.armstrong@braincorp.com (JIRA)

unread,
May 5, 2020, 1:04:03 AM5/5/20
to jenkinsc...@googlegroups.com
Nigel Armstrong updated an issue
Change By: Nigel Armstrong
Component/s: branch-api-plugin
Component/s: remoting

nigel.armstrong@braincorp.com (JIRA)

unread,
May 5, 2020, 1:05:02 AM5/5/20
to jenkinsc...@googlegroups.com
Nigel Armstrong commented on Bug JENKINS-62142
 
Re: Race condition during init between jobs and agent

Looked into this more and this seems to be exclusively an issue in branch-api-plugin, given that jenkins loads nodes at the same time it loads system configuration. Then a later milestone is achieved for loading the jobs. branch-api-plugin should not expect jobs to be loaded when nodes come online. See WorkspaceLocatorImpl.java L#586 (onOnline)

nigel.armstrong@braincorp.com (JIRA)

unread,
May 5, 2020, 1:06:02 AM5/5/20
to jenkinsc...@googlegroups.com

nigel.armstrong@braincorp.com (JIRA)

unread,
May 6, 2020, 1:39:02 PM5/6/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages