diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 61ee6f2ad..e15b8a8ef 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -14,4 +14,5 @@ ## Bug Fixes - +- Fixes a bug where battery pool metrics would stop for one actor when another actor managing the same components stops its pool. + diff --git a/src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py b/src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py index 3b934182f..5ac2b015b 100644 --- a/src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py +++ b/src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py @@ -399,4 +399,9 @@ def _system_power_bounds(self) -> ReceiverFetcher[SystemBounds]: async def stop(self) -> None: """Stop all tasks and channels owned by the BatteryPool.""" - await self._pool_ref_store.stop() + # This was closing the pool_ref_store, which is not correct, because those are + # shared. + # + # This method will do until we have a mechanism to track the resources created + # through it. It can also eventually cleanup the pool_ref_store, when it is + # holding the last reference to it. diff --git a/src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py b/src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py index 0349cbfb5..741b69bbc 100644 --- a/src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py +++ b/src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py @@ -217,7 +217,12 @@ def power_distribution_results(self) -> ReceiverFetcher[_power_distributing.Resu async def stop(self) -> None: """Stop all tasks and channels owned by the EVChargerPool.""" - await self._pool_ref_store.stop() + # This was closing the pool_ref_store, which is not correct, because those are + # shared. + # + # This method will do until we have a mechanism to track the resources created + # through it. It can also eventually cleanup the pool_ref_store, when it is + # holding the last reference to it. @property def _system_power_bounds(self) -> ReceiverFetcher[SystemBounds]: diff --git a/src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py b/src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py index a2c7d9a44..7ae91c4ed 100644 --- a/src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py +++ b/src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py @@ -179,7 +179,12 @@ def power_distribution_results(self) -> ReceiverFetcher[_power_distributing.Resu async def stop(self) -> None: """Stop all tasks and channels owned by the PVPool.""" - await self._pool_ref_store.stop() + # This was closing the pool_ref_store, which is not correct, because those are + # shared. + # + # This method will do until we have a mechanism to track the resources created + # through it. It can also eventually cleanup the pool_ref_store, when it is + # holding the last reference to it. @property def _system_power_bounds(self) -> ReceiverFetcher[SystemBounds]: