Skip to content

Auto-restart unhealthy ML Load Forecaster - #4370

Open
nickgee31 wants to merge 1 commit into
springfall2008:mainfrom
nickgee31:restart-load-ml
Open

Auto-restart unhealthy ML Load Forecaster#4370
nickgee31 wants to merge 1 commit into
springfall2008:mainfrom
nickgee31:restart-load-ml

Conversation

@nickgee31

Copy link
Copy Markdown
Contributor

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.

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.
@springfall2008

Copy link
Copy Markdown
Owner

Is this the right fix or should we just place it in a phase after the cloud components?

@nickgee31

Copy link
Copy Markdown
Contributor Author

Is this the right fix or should we just place it in a phase after the cloud components?

Yeah I can do that, whichever you think is best. I thought a restart would catch anything else as well as the order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants