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]. For more options, visit https://groups.google.com/groups/opt_out.
