It's possible to cause a deadlock in builds when build plans lease multiple working copies, and where the Drydock blueprints for those working copies have limits set on them. I think this describes a different issue in Drydock to the ones I've previously reported, but if not, just close it.
Replication Steps:
- Configure a first working copy blueprint with limit 5.
- Configure a second working copy blueprint with limit 5.
- Configure a build plan that does the following:
- Lease from first working copy
- Lease from second working copy
- Perform some operation on the first working copy (or alternatively just sleep?)
- Perform some operation on the second working copy
- Run lots of builds using this build plan in parallel (I encountered this issue when running the same build plan on HEAD of lots of repositories as I pushed to all of them at the same time, but since there's no "Wait for Previous Commit" here, it should be possible to run into just by triggering builds across a bunch of commits in the same repository as well)
Expected Behaviour:
When no further build steps use a working copy artifact, it should be released at that point, rather than when the build passes / fails.
Actual Behaviour:
Some set of builds will succeed leasing from the first working copy, while still waiting on obtaining the second working copy. Even when the operations on the first working copy are complete (all the run command steps that use them), those leases are held open until those builds complete, but those builds are currently blocked on obtaining a second working copy. Meanwhile, there is another set of builds that have successfully leased the second working copy, but are waiting on leasing the first working copy. Even when they're done with the second working copy, they won't release the lease on that until those builds pass / fail, which won't happen until the lease is obtained on the first working copy.