[JIRA] [branch-api-plugin] (JENKINS-32179) Branch indexing always attempts to create a new project for conflicting branch names from multiple sources

1 view
Skip to first unread message

mjdetullio@gmail.com (JIRA)

unread,
Dec 22, 2015, 5:09:02 PM12/22/15
to jenkinsc...@googlegroups.com
Matthew DeTullio created an issue
 
Jenkins / Bug JENKINS-32179
Branch indexing always attempts to create a new project for conflicting branch names from multiple sources
Issue Type: Bug Bug
Assignee: stephenconnolly
Components: branch-api-plugin
Created: 22/Dec/15 10:08 PM
Environment: Branch API 1.0
Labels: multibranch
Priority: Major Major
Reporter: Matthew DeTullio

cc Jesse Glick

If you have multiple SCMSource s on a multibranch project, for example two Git repos that both have a "master" branch (or any branch name for that matter), and one source does not exclude the conflict, then the MultiBranchProject attempts to create the branch again for each source.

Because the project for that branch already exists and has built, you end up with a bunch of dead executors because builds for these new projects get triggered.

Started
Setting origin to /foo/bar/project1.git
Fetching origin...
Pruning stale remotes...
Getting remote branches...
Checking branch stable
Checking branch feat/tracking-data
Checking branch master
Scheduling build for branch: master
Checking branch development
Scheduling build for branch: development
Checking branch feat/test
Done.
Setting origin to /foo/bar/project2.git
Fetching origin...
Pruning stale remotes...
Getting remote branches...
Checking branch master
Scheduling build for branch: master
Checking branch development
Scheduling build for branch: development
Done.
Finished: SUCCESS
Thread has died

java.lang.IllegalStateException: /Users/mjdetullio/jenkins/jobs/freestyle-multi/branches/master/builds/1 already existed; will not overwrite with freestyle-multi/master #1
	at hudson.model.RunMap.put(RunMap.java:188)
	at jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.java:176)
	at hudson.model.AbstractProject.newBuild(AbstractProject.java:1019)
	at hudson.model.AbstractProject.createExecutable(AbstractProject.java:1210)
	at hudson.model.AbstractProject.createExecutable(AbstractProject.java:145)
	at hudson.model.Executor$1.call(Executor.java:364)
	at hudson.model.Executor$1.call(Executor.java:346)
	at hudson.model.Queue._withLock(Queue.java:1405)
	at hudson.model.Queue.withLock(Queue.java:1270)
	at hudson.model.Executor.run(Executor.java:346)

The obvious solution is to make sure your includes/excludes are properly defined. However, if users do not have a clearly defined naming convention and wish to pull from multiple SCMSource s, then there is nothing to prevent them from entering an erroneous state where multiple projects for a branch exist in memory trying to share the same config location on the filesystem. This in itself is a problem that is easily encountered, even if the use case of having two jobs for a branch with the same name is not supported.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Jan 7, 2016, 3:07:02 PM1/7/16
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-32179
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Jan 7, 2016, 3:07:03 PM1/7/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jan 7, 2016, 3:07:03 PM1/7/16
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-32179
 
Re: Branch indexing always attempts to create a new project for conflicting branch names from multiple sources

The intent was for the first one to “win”. The user should not be obliged to set up exclusions to handle this case.

pwolf@cloudbees.com (JIRA)

unread,
Mar 14, 2016, 1:43:01 PM3/14/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Mar 14, 2016, 1:50:01 PM3/14/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Mar 14, 2016, 1:50:01 PM3/14/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Mar 14, 2016, 9:50:01 PM3/14/16
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Change By: Jesse Glick
Component/s: cloudbees-folder-plugin
Component/s: branch-api-plugin

scm_issue_link@java.net (JIRA)

unread,
Mar 15, 2016, 12:56:01 PM3/15/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-32179
 
Re: Branch indexing always attempts to create a new project for conflicting branch names from multiple sources

Code changed in jenkins
User: Jesse Glick
Path:
src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java
src/test/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolderTest.java
http://jenkins-ci.org/commit/cloudbees-folder-plugin/30f744250762bf9472cd269a0bef4a597203be01
Log:
[FIXED JENKINS-32179] Logic error when computeChildren suggested the same child name twice during recomputation.

scm_issue_link@java.net (JIRA)

unread,
Mar 15, 2016, 12:56:02 PM3/15/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:
src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java
src/test/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolderTest.java

http://jenkins-ci.org/commit/cloudbees-folder-plugin/5f239712601807f3f1eb6f573a8fa550261978a7
Log:
Merge pull request #42 from jglick/duplicate-children-

JENKINS-32179

JENKINS-32179 Logic error when computeChildren suggested the same child name twice during recomputation

scm_issue_link@java.net (JIRA)

unread,
Mar 15, 2016, 12:56:05 PM3/15/16
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Mar 16, 2016, 10:12:01 AM3/16/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
http://jenkins-ci.org/commit/workflow-plugin/5b4c683a801a0685e9d8e3af69c3be096ded6984
Log:
Merge pull request #363 from jglick/duplicate-children-

JENKINS-32179

JENKINS-32179 Integration test

Compare: https://github.com/jenkinsci/workflow-plugin/compare/e161fcfbecac...5b4c683a801a

scm_issue_link@java.net (JIRA)

unread,
Mar 16, 2016, 10:12:03 AM3/16/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

multibranch/pom.xml
multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
http://jenkins-ci.org/commit/workflow-plugin/8739b2321b57cbb638e29ff3941628d11f3057cb
Log:

JENKINS-32179 Integration test.

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:32:32 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:
multibranch/pom.xml
multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java

http://jenkins-ci.org/commit/workflow-multibranch-plugin/596a2cfdfc5cd6353281a59988d119b96b6e9aaa
Log:

JENKINS-32179 Integration test.
Originally-Committed-As: 8739b2321b57cbb638e29ff3941628d11f3057cb

scm_issue_link@java.net (JIRA)

unread,
Dec 1, 2016, 12:10:02 PM12/1/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
http://jenkins-ci.org/commit/workflow-multibranch-plugin/8773373ac64d669333080573724c4c8ffe186ea3
Log:
JENKINS-32179 Can enable test now.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

scm_issue_link@java.net (JIRA)

unread,
Dec 1, 2016, 12:10:04 PM12/1/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages