Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

MetricsComponent runs background services and never checks on them #1773

Closed
gsalgado opened this issue Jun 7, 2020 · 0 comments · Fixed by #1828
Closed

MetricsComponent runs background services and never checks on them #1773

gsalgado opened this issue Jun 7, 2020 · 0 comments · Fixed by #1828

Comments

@gsalgado
Copy link
Contributor

gsalgado commented Jun 7, 2020

That component is also affected by the fire-and-forget anti pattern:

async with contextlib.AsyncExitStack() as stack:
managers = tuple([
await stack.enter_async_context(background_trio_service(service))
for service in services_to_exit
])
await managers[0].wait_finished()

That component runs until the first started service's wait_finished() returns (which can be due to a service crashing). Instead it should probably exit as soon as any of the started services wait_finished()` returns

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant