[Buildbot-devel] acquiring multi-step locks/lock until the end of the build

Vitali Lovich vlovich at gmail.com
Fri Feb 13 17:09:11 UTC 2015


Oh yeah - UnlockBuildLock probably couldn’t just call self.build.releaseLocks since it would only release a particular lock.
Would probably have to introspect the build state a little.

Seems like a feasible solution though.

-Vitali

> On Feb 13, 2015, at 9:07 AM, Vitali Lovich <vlovich at gmail.com> wrote:
> 
> Cool.  Thanks for the suggestion.
> 
> -Vitali
> 
>> On Feb 13, 2015, at 9:06 AM, Pierre Tardy <tardyp at gmail.com <mailto:tardyp at gmail.com>> wrote:
>> 
>> You could create a step:
>> 
>> LockUntilEndOfBuild(MasterLock("foo"))
>> 
>> This step would modify self.build.locks to add this new lock, and then call self.build.acquireLocks()
>> 
>> This should effectively do option 2.
>> 
>> For option 1, you could create a UnlockBuildLock() step that does call self.build.releaseLocks()
>> 
>> There might be some interesting details though :)
>> 
>> 
>> Le Fri Feb 13 2015 at 5:39:50 PM, Vitali Lovich <vlovich at gmail.com <mailto:vlovich at gmail.com>> a écrit :
>> Hi,
>> 
>> Is there a straightforward way to acquire a lock for the remainder of a build?
>> 
>> It looks like we have 2 kinds of locking strategies at the moment:
>> Up-front locks for each build generated by a builder
>> Step-level locks acquired only for the duration of a single step
>> The two that are super-useful but missing:
>> Acquire a lock for the next N steps or until some later step (worst case is acquire/release steps but probably can be done more elegantly as “lock until build step with name X” or “lock for next Y steps").
>> Acquire a lock for the remainder of the build.
>> Does anyone know if the latter is easy to inject?  I haven’t looked into it yet; I’m hoping that it would be possible but maybe someone has looked into this already & has thoughts?
>> Any pointers on which class owns the locks?
>> 
>> I already have a custom Build class & am OK mucking with the internal state of a build.
>> I’m looking primarily at option #2 - would I get away with generating a lock & then appending it to some internal state in Build
>> for it to get unlocked at the end of the build?
>> 
>> Thanks,
>> Vitali
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net/ <http://goparallel.sourceforge.net/>_______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net <mailto:Buildbot-devel at lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel <https://lists.sourceforge.net/lists/listinfo/buildbot-devel>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150213/4a91dab0/attachment.html>


More information about the devel mailing list