<div dir="ltr">Thanks for the prompt reply! <div><br></div><div>Our locks are defined as you can see here <a href="https://github.com/MariaDB/buildbot/blob/main/locks.py">https://github.com/MariaDB/buildbot/blob/main/locks.py</a> and then each build receives as argument the lock function <a href="https://github.com/MariaDB/buildbot/blob/cd5378a7b6549e3bf5930306c2eed29239aa3a38/master.cfg#L961">https://github.com/MariaDB/buildbot/blob/cd5378a7b6549e3bf5930306c2eed29239aa3a38/master.cfg#L961</a>. However, for example this build (<a href="https://buildbot.mariadb.org/#/builders/348/builds/1638">https://buildbot.mariadb.org/#/builders/348/builds/1638</a>) is now waiting for 6h to acquire the locks. Overall there are 11 builds that have started and are waiting for locks currently. I have considered this to be normal, but if you think there is an issue please let me know.</div><div><div><br></div><div>Thank you!</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 9:52 PM Povilas Kanapickas <<a href="mailto:povilas@radix.lt">povilas@radix.lt</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
If you use renderable *builder* locks then they will not cause builds to<br>
wait for the locks. The builder lock resolution happens before the build<br>
actually starts, even before the canStartBuild function.<br>
<br>
Starting a build that later can't acquire the builder locks we just<br>
checked should be rare occurrence. If that's not the case, it's a bug I<br>
would be interested in investigating.<br>
<br>
So what I would do is to set builder locks argument to a renderable<br>
function, within that function I would check interesting build<br>
properties such as which worker the build is about to start on and then<br>
return a set of locks that must be acquired. This way you would have<br>
almost complete flexibility. For each resource you can have separate<br>
master lock with maxCount representing maximum resource utilization<br>
(e.g. 512GB RAM or whatever) and then the builders would take e.g.<br>
lock.access('counting', count=8) to acquire a 8GB ram slice).<br>
<br>
Regards,<br>
Povilas<br>
<br>
On 2022-07-04 21:39, Vlad Bogolin wrote:<br>
> Hi,<br>
> <br>
> Thank you for your reply! Is there any way to customize what<br>
> oversubscribed means? We already use a locking mechanism, but still this<br>
> translates into having multiple running builds that just wait for the<br>
> locks for several hours. Ideally, I would like to avoid this.<br>
> <br>
> Also, by any chance, can you read a lock value from the canStartBuild<br>
> function?<br>
> <br>
> Thank you!<br>
> Vlad Bogolin <br>
> <br>
> On Fri, Jul 1, 2022 at 12:40 PM Povilas Kanapickas <<a href="mailto:povilas@radix.lt" target="_blank">povilas@radix.lt</a><br>
> <mailto:<a href="mailto:povilas@radix.lt" target="_blank">povilas@radix.lt</a>>> wrote:<br>
> <br>
>     Hi Vlad,<br>
> <br>
>     You could setup a number of master locks that are each assigned to a<br>
>     particular physical machine. Then you can setup renderable locks for<br>
>     builds: a build would look into what physical machine it's about to<br>
>     launch on and select the correct lock. If the physical machine is<br>
>     oversubscribed, Buildbot will notice that lock can not be acquired look<br>
>     for another worker for the build.<br>
> <br>
>     Regards,<br>
>     Povilas<br>
> <br>
>     On 2022-06-28 12:44, Vlad Bogolin wrote:<br>
>     > Hello,<br>
>     ><br>
>     > We are using buildbot with primary DockerLatentWorkers for our CI. So,<br>
>     > given a physical machine, we have several DockerLatentWorkers that may<br>
>     > run on it. While this works well, in some cases buildbot starts<br>
>     too many<br>
>     > latent workers on the same machine. Is there a way to limit starting<br>
>     > builds for a particular DockerLatentWorker if others are already<br>
>     running<br>
>     > on the same machine?<br>
>     ><br>
>     > I feel like this should be achievable using the canStartBuild, but<br>
>     I am<br>
>     > unsure how. Is it possible to access the full list of defined latent<br>
>     > workers and see if one is on or not in the canStartBuild function?<br>
>     ><br>
>     > Thank you!<br>
>     > Vlad Bogolin<br>
>     ><br>
>     > _______________________________________________<br>
>     > users mailing list<br>
>     > <a href="mailto:users@buildbot.net" target="_blank">users@buildbot.net</a> <mailto:<a href="mailto:users@buildbot.net" target="_blank">users@buildbot.net</a>><br>
>     > <a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.buildbot.net/mailman/listinfo/users</a><br>
>     <<a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.buildbot.net/mailman/listinfo/users</a>><br>
>     ><br>
> <br>
> <br>
> <br>
> -- <br>
> Vlad<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Vlad</div></div>