Auto-restart unhealthy ML Load Forecaster - #4370
Open
nickgee31 wants to merge 1 commit into
Open
Conversation
Add automatic restart support for unhealthy components. Mark LoadML component with "auto_restart": True. Components now track restart_tasks and provide auto_restart() to schedule a single automatic restart via base.create_task (avoids double-scheduling). PredBat triggers auto_restart for non-calculating failed components. Update tests (FakeComponents) to record and assert auto-restart behavior, including ensuring calculating components are not restarted. Improves resilience by rebooting unhealthy components while avoiding interference during active calculations.
Owner
|
Is this the right fix or should we just place it in a phase after the cloud components? |
Contributor
Author
Yeah I can do that, whichever you think is best. I thought a restart would catch anything else as well as the order |
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.
Summary
Automatically restart the ML Load Forecaster component when it becomes unhealthy outside of an active calculation. At the moment ML Load Forecaster can start before the Solis Cloud API component which leaves it in an error state until manually restarted.
Changes
• Added an auto_restart component setting, enabled only for load_ml.
• Added guarded asynchronous component restart handling to prevent duplicate concurrent restarts.
• Triggered automatic recovery when LoadML is active, unhealthy, and not calculating.
• Avoided restarting LoadML while it is performing training, prediction, or database work.
• Added tests covering automatic restart requests and ensuring calculating LoadML instances are not restarted.
Behaviour
Other components are unaffected. Genuine LoadML failures are still reported, but Predbat now attempts to recover the component automatically using the existing restart lifecycle.