-
Notifications
You must be signed in to change notification settings - Fork 8
chore(v3): fix state management race condition #3203
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
Conversation
|
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer: Airgap Installer (may take a few minutes before the airgap bundle is built): Happy debugging! |
|
|
||
| if err := c.setAppUpgradeStatus(types.StateSucceeded, "Upgrade complete"); err != nil { | ||
| return fmt.Errorf("set status to succeeded: %w", err) | ||
| } |
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.
Bug: Error Handler Fails Post-Success
If setAppUpgradeStatus fails after successfully transitioning to StateSucceeded, the error-handling defer attempts to transition from StateSucceeded to StateAppUpgradeFailed. This transition is likely invalid in the state machine, causing the error handler itself to fail. The status update should either not return an error that triggers the defer, or the defer should check the current state before attempting transitions.
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.
good feedback
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.
never mind. im reverting
What this PR does / why we need it:
This PR refactors the state machine implementation to fix state management issues in the v3 API. The key changes include:
Which issue(s) this PR fixes:
[sc-130867]
Does this PR require a test?
Yes - Added new test files:
api/controllers/kubernetes/install/reporting_handlers_test.goapi/controllers/linux/install/reporting_handlers_test.goapi/controllers/linux/upgrade/reporting_handlers_test.goAlso updated existing tests to align with the new state machine signature and status management patterns.
Does this PR require a release note?
Does this PR require documentation?
NONE