Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/frequenz/sdk/actor/_background_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,6 @@ def __await__(self) -> collections.abc.Generator[None, None, None]:
"""
return self.wait().__await__()

def __del__(self) -> None:
"""Destroy this instance.

Cancel all running tasks spawned by this background service.
"""
self.cancel("{self!r} was deleted")

Comment on lines -271 to -277
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the fix is to check if the event loop is running before calling cancel, because when the loop is there, we still want to cancel and cleanup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but I don't think we gain much from that tbh. Cleanup should not rely on del

def __repr__(self) -> str:
"""Return a string representation of this instance.

Expand Down
Loading