We have dozen of multistage YAML pipelines responsible for deploying microservices. Each of them has a stage A which targets EnvA environment with an Exclusive Lock enabled.
The Exclusive lock guarantees us two things:
- the latest run only from each of the pipeline can be executed (batch behavior)
- only one run across all of the pipelines can use the EnvA environment at the same time, other are waiting when the environment will be free
The environment has also an Azure Function check which verifies the time of the day and allows or forbids deployment. It means that for example, the Azure Function allows deployment between 8.00 - 10.00 and 14:00 - 16:00.
The only documentation about this feature is The exclusive lock check allows only a single run from the pipeline to proceed. All stages in all runs of that pipeline which use the resource are paused. When the stage using the lock completes, then another stage can proceed to use the resource. Also, only one stage will be allowed to continue. Any other stages which tried to take the lock will be cancelled. Exclusive lock
There is not any information on how the timeout works for the Exclusive lock:
Is it the max time the stage could occupy the EnvA environment and for example if the timeout is set for 10 minutes but the stage's job takes 20mins then after 10 minutes the lock is released and the next pipeline can use this environment even the previous one is still in progress?
When the timeout starts, when a particular pipeline's stage locked the environment? Or when the pipeline stage starts and is waiting in a queue for pipeline A, B, C, D to release the EnvA environment?
What are the states of the Exclusive lock, acquired, obtained? How to track the queue of the pipelines which waits for other pipelines to release the lock?

