Hello and thank your answer!
I  am also working with this, together with Daniel.

The locks and latches plugin is interesting, I am not sure i understand how 
we would use it though.

One solution (if possible) is to find an extension point with these 
requirements:
* canRun has been called, and the job is NOT blocked, and is about the be 
started.
* assignedBuildNumber has NOT been called yet, so the build does not have a 
build number yet

Then the distributed lock could be locked in that extension point, 
preventing others from reading the build number, and then release the lock 
when everyone has the new build number,.



On Monday, February 11, 2013 6:17:50 PM UTC+1, HX_unbanned wrote:
>
> I might be wrong and do not understand fully your test case. but is there 
> no option to use locks nad latches plugin? As long as you trigger job B 
> from job A and use same Lock, you will prevent unsynced build ... and get 
> the same effect as pooling. Of course, if you need simutaniously perfomed 
> builds, it is not and option..
>
> 2013/2/11 Daniel Olausson <[email protected] <javascript:>>
>
>> Hi,
>>
>> We are writing a plugin to synchronize the build number between two or 
>> more instances of Jenkins running the same job.
>>
>> That is, if we start jobA on one Jenkins instance and it gets build 
>> number 5, if jobA starts on another Jenkins instance it should get number 6.
>>
>> We have been successful in doing this but it's not atomically, which 
>> means that if we start the job at exactly the same time, they will get the 
>> same build number.
>> Right now we send a message when a job is started to the other Jenkins 
>> instances which will trigger a call to the 'updateNextBuildNumber' method.
>>
>> The easiest way would be if we could make the 'assignBuildNumber' method 
>> on the Jenkins instances mutual exclusive, and when 'assignBuildNumber' is 
>> called the build number on the other jenkeses
>> are updated. However we have not found a way to modify the 
>> 'assignBuildNumber' method without modifying the jenkins core.
>>
>> Our plan to achieve mutual exclusion is to use a distributed lock, which 
>> will prevent concurrent access to the build number. 
>>
>> We want to lock the lock before 'assignBuildNumber' is called, and 
>> release it when we know that all instances have updated their build number.
>>
>> Do you know any good extension points for this?
>>
>>
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> A.C. Linards L. 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to