Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Guarantee deployment order on race conditions #248

Open
mpdude opened this issue Jun 17, 2020 · 0 comments
Open

Feature request: Guarantee deployment order on race conditions #248

mpdude opened this issue Jun 17, 2020 · 0 comments

Comments

@mpdude
Copy link

mpdude commented Jun 17, 2020

This is not exactly an issue for the CodeDeploy Agent itself, but rather for the product API. Anyway, I am posting it here since I hope it will make it way into the CodeDeploy product team and I don't know a better place to try. So:

When calling the CodeDeploy API to trigger a new deployment from build pipelines (GitHub Actions, in my case, if that matters), it may happen that a CreateDeployment call fails with a DeploymentLimitExceededException because another deployment is currently running.

In this case, all you can do with the JavaScript SDK is to call the waitFor method to... well... wait for the current deployment to finish and then try again.

Now, with long-running deployments and/or frequent commits, this effectively makes different builds race for the next deployment to happen. The result might not be what you would expect, regarding the order of deployments as well as the final (last) deployment made.

My suggestion is to add a new, optional parameter to the CreateDeployment call that can pass some kind of identifier. The API could reject CreateDeployment calls with a dedicated error code if this parameter is not monotonically increasing with regard to the last deployment created (or the currently active deployment?).

With this, things like CI build sequence numbers, build start timestamps or similar could be used to make sure we deploy "in order", possibly skipping deployments if they have been "overtaken" by newer ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants