-
Notifications
You must be signed in to change notification settings - Fork 357
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
Canceling deployment is superseded by new deployment #3072
Canceling deployment is superseded by new deployment #3072
Conversation
There are two active states for deployments (DEPLOYING, CANCELING) and two corresponding actions (DeploymentCreate, DeploymentCancel). This results in the following possible scenarios: | state + action = updated state / (new deployment) --------------------------------------------------------------------- 1 | DEPLOYING | create | SUPERSEDED | DEPLOYING 2 | DEPLOYING | cancel | CANCELING | - 3 | CANCELING | cancel | CANCELING | - 4 | CANCELING | create | CANCELING | DEPLOYING Scenario 4 (CANCELING + create) currently leads to two active deployments for an app (CANCELING + DEPLOYING). As the Dispatcher and Updater (module DeploymentUpdater) are not designed to handle two active deployments concurrently, the result for this scenario has been changed: | state + action = updated state / (new deployment) --------------------------------------------------------------------- 4 | CANCELING | create | SUPERSEDED | DEPLOYING This means that the 'create' action now sets a CANCELING deployment to SUPERSEDED (CANCELED) and during the next run of the DeploymentUpdater, the new DEPLOYING deployment will be processed. Furthermore the Updater (module DeploymentUpdater) now checks that the deployment being processed is still in the expected state.
e910b7d
to
d1dd3e7
Compare
Hi @philippthun, I was thinking whether our discussions in this Slack thread regarding how should a |
When a deployment train is canceled, the latest interim web process is scaled up. The introduction of a SUPERSEDED (CANCELED) state requires a change to how this latest interim web process is determined. Let's assume the following sequence of actions: create create cancel create cancel This would result in the following states (after each action): DEPLOYING SUPERSEDED (DEPLOYED) + DEPLOYING SUPERSEDED (DEPLOYED) + CANCELING SUPERSEDED (DEPLOYED) + SUPERSEDED (CANCELED) + DEPLOYING SUPERSEDED (DEPLOYED) + SUPERSEDED (CANCELED) + CANCELING And this should result in the web process from the SUPERSEDED (CANCELED) deployment to be skipped and the one from the SUPERSEDED (DEPLOYED) deployment to be scaled up.
7f15557
to
2918321
Compare
The introduction of a SUPERSEDED (CANCELED) state requires the Updater (module DeploymentUpdater) to handle the interim web process belonging to such a SUPERSEDED (CANCELED) deployment. The cleanup of unused web processes happens at the end of a (successful or canceled) deployment. But as the canceled interim web process should not be used anymore, it is now immediately scaled to zero instances.
2918321
to
0aaa62c
Compare
I would like to focus this PR on the problem described in issue #3019. |
This is the output of
Footnotes
|
Two additional notes to the comment above:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable to me. Want to also say I appreciated the commit messages in the three commits. It made it easy to see what your flow was and easier to review the smaller pieces that make up the fix
There are two active states for deployments (
DEPLOYING, CANCELING
) and two corresponding actions (DeploymentCreate
,DeploymentCancel
). This results in the following possible scenarios:Scenario 4 (
CANCELING
+create
) currently leads to two active deployments for an app (CANCELING
+DEPLOYING
). As theDispatcher
andUpdater
(moduleDeploymentUpdater
) are not designed to handle two active deployments concurrently, the result for this scenario has been changed:This means that the
create
action now sets aCANCELING
deployment toSUPERSEDED
(CANCELED
) and during the next run of theDeploymentUpdater
, the newDEPLOYING
deployment will be processed.Furthermore the
Updater
(moduleDeploymentUpdater
) now checks that the deployment being processed is still in the expected state.Skip interim web processes from SUPERSEDED (CANCELED) deployments
When a deployment train is canceled, the latest interim web process is scaled up. The introduction of a
SUPERSEDED
(CANCELED
) state requires a change to how this latest interim web process is determined.Let's assume the following sequence of actions:
This would result in the following states (after each action):
DEPLOYING
SUPERSEDED
(DEPLOYED
) +DEPLOYING
SUPERSEDED
(DEPLOYED
) +CANCELING
SUPERSEDED
(DEPLOYED
) +SUPERSEDED
(CANCELED
) +DEPLOYING
SUPERSEDED
(DEPLOYED
) +SUPERSEDED
(CANCELED
) +CANCELING
And this should result in the web process from the
SUPERSEDED
(CANCELED
) deployment to be skipped and the one from theSUPERSEDED
(DEPLOYED
) deployment to be scaled up.Scale canceled web processes to zero
The introduction of a
SUPERSEDED
(CANCELED
) state requires theUpdater
(moduleDeploymentUpdater
) to handle the interim web process belonging to such aSUPERSEDED
(CANCELED
) deployment.The cleanup of unused web processes happens at the end of a (successful or canceled) deployment. But as the canceled interim web process should not be used anymore, it is now immediately scaled to zero instances.
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests