Environment Locking

2 minute readReferenceAutomation

CloudBees CD/RO allows simultaneous application and microservice deployments to the same environment. These deployments can be for the same or different applications or microservices. This can lead to deployment failures when deployment steps are working on the same resources, for examples modifying the same files or starting and stopping the same application server.

Environment locking for exclusive access restricts simultaneous deployments configured for the same environment. It allows application or microservice to exclusively lock an environment for a deployment. When an environment is locked, all other deployments that are started after the lock is acquired are queued.

Exclusive environment access is configured on application processes, top-level microservices, or both at object create/edit time. See information about setting exclusive access in Authoring application processes. At runtime, CloudBees CD/RO checks environment availability:

If there is a ongoing reservation or active blackout period on the environment {PRODUCT} inserts Waiting for Environment Reservation as the first step in the deployment job. Once the reservation or blackout ends and the process requires exclusive access but the environment is not available, users notice Waiting for Environment Reservation step is renamed to Waiting for Environment Availability.
Otherwise, {PRODUCT} inserts Checking Environment Availability as the first step in the deployment job. If the process requires exclusive access but the environment is not available this step is renamed Waiting for Environment Availability.
When using rolling deploy, Checking Environment Availability is inserted only once regardless of the number of phases or batches.

Determining Blocking Processes

You can determine on which jobs a waiting process is pending: click on Waiting for Environment Availability to bring up the Job Details page. From there, select the Properties tab—the ec_waitingForJobs property lists the blocking jobs.