I believe that the behavior you are seeing is by design.  The concurrent builds 
checkbox allows you to run multiple instances of that job at all, but the SCM 
poller will only launch one at a time.  Basically, with the checkbox you could 
kick off as many builds as you wanted manually.

If you really want to be able to launch a build at 12:30 in the below case, you 
need two jobs.

Job A monitors SCM, and when it sees an SCM change, it launches job B.

Job B doesn't monitor SCM at all.  It lets job A kick it off, grabs sources 
from SCM, and goes to work on it.  You will need the concurrent build flag on 
this one.

I have something similar in my own setup.  Job A doesn't have any meaningful 
build actions, but has a post-build action of "trigger parameterized build on 
other projects" (IIRC, you need the Parameterized Trigger plugin).  Tell job A 
to launch job B in that post-build action and pass any SCM information (such as 
branch) as a parameter.  So now, the timeline goes as:

12:00 Jenkins Project A polls Mercurial and sees a change.  Starts build #A-1
12:02 Jenkins A-1 launches job against project B (build #B-1) and exits out.  
Job #B-1 runs for the next 80 minutes
12:15 Another change is made in mercurial.
12:30 Jenkins job A polls Mercurial (since it isn't running a build on project 
A) and sees a change, starting build #A-2
12:32 Jenkins A-2 launches #B-2, which runs for the next 80 minutes.  A-1 exits 
out.
13:20 Jenkins job B-1 finishes
13:50 Jenkins job B-2 finishes

--Rob

-----Original Message-----
From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of David Shaw
Sent: Thursday, May 09, 2013 3:18 PM
To: jenkinsci-users@googlegroups.com
Subject: Concurrent builds with SCM polling

Hello,

Here's what I'm trying to do: I have a project stored in Mercurial and I want 
to have Jenkins check every 30 minutes for changes (build trigger to poll the 
SCM every 30 minutes), and if it finds any changes, to build that project.  
That part works fine.  However, the project takes a long time to build, and for 
some reason Jenkins won't build the project a second time while there is a 
build in progress.

So this is what happens, starting at 12 noon:

12:00    Jenkins sees a change in Mercurial.  Starts build #1.
12:15    Another change made in Mercurial
12:30    Jenkins can't manage to poll for a change.  The Mercurial Polling Log 
just shows "Started on (date) 12:30" and never progresses past that single line.
13:20    Build #1 finishes.  Suddenly the polling is unblocked and Jenkins sees 
the change made at 12:15.  Kicks off build #2.

To answer the obvious question first, concurrent builds are definitely enabled. 
 Concurrent builds work fine if I hit the "build now" link while a build is 
taking place.  It only doesn't work with Mercurial polling.

Having read that some plugins can cause this problem, I've gone so far as to 
install a brand new Jenkins box with no additional plugins aside from the 
Mercurial one, and created a job description that has no build steps other than 
"sleep 120", and no post-build actions.  I've tried it with both a single 
Jenkins box as well as a master/slave architecture.  I've walked the Jenkins 
and Mercurial plugin version up and down as well.  No dice with any of these.

Any advice would be very welcome.

David

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


The information in this message is for the intended recipient(s) only and may 
be the proprietary and/or confidential property of Litle & Co., LLC, and thus 
protected from disclosure. If you are not the intended recipient(s), or an 
employee or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any use, dissemination, distribution or 
copying of this communication is prohibited. If you have received this 
communication in error, please notify Litle & Co. immediately by replying to 
this message and then promptly deleting it and your reply permanently from your 
computer.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to