Skip to content

fix startup condition problem with plan#4110

Merged
springfall2008 merged 1 commit into
mainfrom
fix/gateway_startup2
Jun 22, 2026
Merged

fix startup condition problem with plan#4110
springfall2008 merged 1 commit into
mainfrom
fix/gateway_startup2

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 22, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a ComponentBase startup edge-case where a component can set api_started from a background task before run(first=True) returns, which previously could keep the component stuck in the startup/backoff path and prevent steady-state housekeeping (including plan publishing).

Changes:

  • Ensure ComponentBase.start() clears the first flag after any successful run(), even if api_started was already set externally.
  • Add a regression test covering the “run() pre-sets api_started” scenario.
  • Bump Predbat version to v8.41.3.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/predbat/component_base.py Clears first after successful startup regardless of who set api_started, preventing repeated startup/backoff runs.
apps/predbat/tests/test_component_base.py Adds a regression test validating first transitions to False even when run() sets api_started before returning.
apps/predbat/predbat.py Version bump to v8.41.3.

Comment on lines +336 to +338
# Wait long enough (sped up 100x by fast_sleep → ~2s real) for the component
# loop to advance past simulated seconds=60 so a steady-state run can occur.
await asyncio.sleep(200)
@springfall2008 springfall2008 merged commit e201937 into main Jun 22, 2026
2 checks passed
@springfall2008 springfall2008 deleted the fix/gateway_startup2 branch June 22, 2026 10:44
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