ArchitectureDeploy pipeline
The service lock
The service lock lets one operation at a time change the containers of a service.
Before it starts instances, the deploy takes the lock of the service.
1 / 4
Each service has one service lock. A deploy takes it at the start of the state deploying and keeps it until the deploy ends.
Why it exists
Many parts of the engine change containers: a deploy, the reconciler, a scale, a suspend. With the lock, they do not touch the containers of a deploy in progress.
The reconciler never waits for the lock. It skips a busy service until its next pass. Thus the reconciler never works against a deploy.