Cloudrun for Anthos: Conflict two different revision tags trying update a service yaml file

devedu
New Member

I have service name default-api. we are using cloudrun for deployments of our services. Against each Pull request we create a new revision and a unique tag (pr number) as its Tag inside the service default-api.


The issue is when two deployments are running in parallel and tries to update the service YAML file, the deployment which tries to update the YAML after the first one gets the conflict.

Is there a possible way to avoid this conflict?

0 1 246
1 REPLY 1

Hi,

This problem arises when multiple automated deployment processes try to update the same Kubernetes resource, such as a Cloud Run service, at the same time.

To avoid these conflicts, you can consider implementing one or more of the following strategies:

(1) Ensure that deployments are serialized so that only one deployment process can update the service at a time. This can be achieved by using CI/CD pipeline features that queue deployment jobs or by implementing a locking mechanism in your deployment scripts.

(2) Modify your deployment process to retry updates in case of conflicts, preferably with exponential backoff. This approach allows concurrent deployments to eventually succeed without requiring them to be strictly serialized.

I hope that helps

Regards

Mahmoud

Top Labels in this Space