-
Notifications
You must be signed in to change notification settings - Fork 120
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
Change check for start_retirement to not initialized vs retiring #281
Change check for start_retirement to not initialized vs retiring #281
Conversation
@tinaafitz pls review |
@miq-bot add_label enhancement |
@@ -17,7 +17,7 @@ | |||
exit MIQ_ABORT | |||
end | |||
|
|||
if stack.retiring? |
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.
@d-m-u Lets put back this original code check
if stack.retiring?
$evm.log('error', "Stack is in the process of being retired. Aborting current State Machine.")
exit MIQ_ABORT
end
@@ -17,7 +17,7 @@ | |||
exit MIQ_ABORT | |||
end | |||
|
|||
if stack.retiring? | |||
unless stack.retirement_initialized | |||
$evm.log('error', "Stack is in the process of being retired. Aborting current State Machine.") |
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.
@d-m-u Let's change the error message to something like: "Stack has not been initialized for retirement. Aborting current State Machine."
@tinaafitz can you re-review please? |
@@ -17,7 +17,7 @@ | |||
exit MIQ_ABORT | |||
end | |||
|
|||
if vm.retiring? |
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.
@d-m-u We need 3 separate checks in all of the start_retirement methods.
The methods already have 2 of the checks
if stack.retired?
$evm.log('error', "Stack is already retired. Aborting current State Machine.")
exit MIQ_ABORT
end
if stack.retiring?
$evm.log('error', "Stack is in the process of being retired. Aborting current State Machine.")
exit MIQ_ABORT
end
We need to add this check:
unless unless stack.retirement_initialized?
$evm.log('error', "Stack has not been initialized for retirement. Aborting current State Machine.")
exit MIQ_ABORT
end
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.
@d-m-u Could you modify the start_retirement methods to have the 3 checks as described in my last comment?
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.
@@ -22,6 +22,11 @@ | |||
exit MIQ_ABORT | |||
end | |||
|
|||
unless vm.retirement_initialized? | |||
$evm.log('error', "VM has not been initialized for retirement. Aborting current State Machine.") | |||
exit MIQ_ABORT |
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.
@d-m-u Can you raise an exception instead of exiting, it helps when we test.
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 pull request is not mergeable. Please rebase and repush. |
Checked commit d-m-u@9aa367b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@mkanoor bump |
Previously this check was for retiring but with ManageIQ/manageiq#17280 we're adding a state of initializing to prevent more than one worker from entering the state machine for the same service. The previous retiring check needs to be an initializing check.
Depends on
ManageIQ/manageiq-automation_engine#173