Skip to content

Commit 058aac7

Browse files
committed
Don't stop pools
When there are multiple pool instances controlling the same components and one of them stops, that would stop all the pools. This commit adds an emergency fix to prevent this bug, to buy some time to come up with a better solution. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent aee9f44 commit 058aac7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,9 @@ def _system_power_bounds(self) -> ReceiverFetcher[SystemBounds]:
399399

400400
async def stop(self) -> None:
401401
"""Stop all tasks and channels owned by the BatteryPool."""
402-
await self._pool_ref_store.stop()
402+
# This was closing the pool_ref_store, which is not correct, because those are
403+
# shared.
404+
#
405+
# This method will do until we have a mechanism to track the resources created
406+
# through it. It can also eventually cleanup the pool_ref_store, when it is
407+
# holding the last reference to it.

src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,12 @@ def power_distribution_results(self) -> ReceiverFetcher[_power_distributing.Resu
217217

218218
async def stop(self) -> None:
219219
"""Stop all tasks and channels owned by the EVChargerPool."""
220-
await self._pool_ref_store.stop()
220+
# This was closing the pool_ref_store, which is not correct, because those are
221+
# shared.
222+
#
223+
# This method will do until we have a mechanism to track the resources created
224+
# through it. It can also eventually cleanup the pool_ref_store, when it is
225+
# holding the last reference to it.
221226

222227
@property
223228
def _system_power_bounds(self) -> ReceiverFetcher[SystemBounds]:

src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ def power_distribution_results(self) -> ReceiverFetcher[_power_distributing.Resu
179179

180180
async def stop(self) -> None:
181181
"""Stop all tasks and channels owned by the PVPool."""
182-
await self._pool_ref_store.stop()
182+
# This was closing the pool_ref_store, which is not correct, because those are
183+
# shared.
184+
#
185+
# This method will do until we have a mechanism to track the resources created
186+
# through it. It can also eventually cleanup the pool_ref_store, when it is
187+
# holding the last reference to it.
183188

184189
@property
185190
def _system_power_bounds(self) -> ReceiverFetcher[SystemBounds]:

0 commit comments

Comments
 (0)