[daemon/imon] End a provision orchestration on a failed start - #1127
Merged
Merged
Conversation
A provision provisions what needs provisioning and starts what does not, so an object whose every resource reports its provisioned state as n/a is never provisioned by it, only started. The end of the orchestration did not know that: it recognized a provision failure and nothing else, where the switch above it already routed a start failure to the failure handler. A failed start therefore ended nothing. The instance monitor retries no failed action, so the orchestration stayed running with nothing left to run it, and "om <path> provision --wait" waited out its whole timeout on an object that had given up in the first second. Seen on a QA object of three sgcp resources, none of which has a provisioner, reproduced on the lab with a single app.simple resource whose start exits non-zero. Both states now end it, on the local instance, on the leader a peer waits for, and on all of them at once. The verdict the client is handed names what failed, "orchestration failed: start failed on dev2n1", in place of a timeout that named nothing.
…reported A start action can fail and leave the instance started anyway, a timeout on an object whose resources did come up being the plain case. Ending the provision orchestration on a start failure made that a failure, where the success conditions used to have it: a start failure reached them by falling through the failure block. The verdict was the smaller half of it. The stopped flag is cleared and the monitor enabled on the success path alone, so an object that came up was left with the flag its creation set and its failover disabled, which is what ending on a start failure set out to avoid. Check the instance first, as the started orchestration does in startedFromStartFailed: a start failure ends this one only while the instance is not started. A genuine failed start, the one that left the orchestration running with nothing to run it, ends it as before. Provision failure precedence is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A provision provisions what needs provisioning and starts what does not, so an object whose every resource reports its provisioned state as n/a is never provisioned by it, only started. The end of the orchestration did not know that: it recognized a provision failure and nothing else, where the switch above it already routed a start failure to the failure handler.
A failed start therefore ended nothing. The instance monitor retries no failed action, so the orchestration stayed running with nothing left to run it, and "om provision --wait" waited out its whole timeout on an object that had given up in the first second. Seen on a QA object of three sgcp resources, none of which has a provisioner, reproduced on the lab with a single app.simple resource whose start exits non-zero.
Both states now end it, on the local instance, on the leader a peer waits for, and on all of them at once. The verdict the client is handed names what failed, "orchestration failed: start failed on dev2n1", in place of a timeout that named nothing.