Merged
Conversation
Contributor
Marenz
commented
Jun 24, 2025
- Set min numpy version to lowest prebuilt python3.13-compatible release
- ComponentTracker: Use run_forever with eventloop fixes for _run() loop
- Actor: Don't restart on RuntimeError:No Running Eventloop
- Use get_running_loop() instead of str cmp to check for a running event loop
- cancel_and_wait: Re-raise if it was our task
- Fix swallowing of cancel error in Formula Engine & Voltage streamer
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up CI compatibility and refines event loop and cancellation handling across several components.
- Bump numpy to ≥2.1.0 for Python 3.13 compatibility
- Propagate
CancelledErrorinstead of breaking loops in FormulaEngine and VoltageStreamer - Centralize continuous retry loops via
run_foreverand prevent actor restarts when no running event loop - Improve
cancel_and_awaitto re-raise cancellation and abort on missing event loop
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frequenz/sdk/timeseries/formula_engine/_formula_engine.py | Replace break with raise for CancelledError propagation |
| src/frequenz/sdk/timeseries/_voltage_streamer.py | Replace break with raise for CancelledError propagation |
| src/frequenz/sdk/microgrid/_power_distributing/_component_status/_battery_status_tracker.py | Wrap the main loop in run_forever |
| src/frequenz/sdk/actor/_actor.py | Skip restart when no event loop is running |
| src/frequenz/sdk/_internal/_asyncio.py | Refine cancel_and_await, add is_loop_running, abort on missing loop |
| pyproject.toml | Update numpy dependency to >=2.1.0,<3 |
Comments suppressed due to low confidence (1)
src/frequenz/sdk/actor/_actor.py:109
- [nitpick] The new branch that skips restarts when no event loop is running should be covered by a unit or integration test to prevent regressions.
if not is_loop_running():
src/frequenz/sdk/microgrid/_power_distributing/_component_status/_battery_status_tracker.py
Show resolved
Hide resolved
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
…t loop Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Reraise the cancel error if it was our task that was cancelled. Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
shsms
approved these changes
Jun 24, 2025
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.