fix: fail deployment if prepare bootstrap fails#1657
Open
alter-mage wants to merge 1 commit intomainfrom
Open
Conversation
| } catch (IOException e) { | ||
| // TODO: better handling of error codes for different IO operations | ||
| rollback(deployment, e); | ||
| rollback(deployment, e, false); |
yitingb
reviewed
Aug 29, 2024
| final boolean bootstrapOnRollbackRequired = kernelAlternatives.prepareBootstrapOnRollbackIfNeeded( | ||
| kernel.getContext(), deploymentDirectoryManager, bootstrapManager); | ||
| // Persist deployment metadata only if restart is required | ||
| if (requiresRestart) { |
Member
There was a problem hiding this comment.
QQ: when bootstrap prepared failed, and we don't persist the deployment metadata, if we use systemctl to restart Nucleus, would it still look for deployment metadata when restarting?
Member
Author
There was a problem hiding this comment.
We will still persist deployment metadata but only in the launch directory of the deployment that failed. After rollback, the launch directory will revert back to previous one (before current deployment was received). So after restart, yes, Nucleus will still look for deployment metadata but its fine if it does not find it and will launch in default mode.
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.
Issue #, if available:
Description of changes:
Do not restart Nucleus if kernel update deployment fails while preparing bootstrap. Instead, fail the deployment and start up all the services currently configured.
Something which is a bit unknown is what should the behavior be like if rollback fails.
Why is this change necessary:
Nucleus restart is unnecessary if preparing bootstrap fails and adds the possibility of a Nucleus Restart Failure when the Nucleus does eventually start up.
How was this change tested:
Any additional information or context required to review the change:
Documentation Checklist:
Compatibility Checklist:
any deprecated method or type.
Refer to Compatibility Guidelines for more information.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.