Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[batch] Fix async exit stacks #13969

Merged
merged 2 commits into from
Nov 2, 2023
Merged

Conversation

jigold
Copy link
Contributor

@jigold jigold commented Nov 2, 2023

I couldn't find the best issue for this. Should fix #13908, but I thought there was another issue about reducing noisy grafana alerts which this PR also addresses.

Copy link
Contributor

@danking danking left a comment

Choose a reason for hiding this comment

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

Great change!

@@ -161,18 +165,21 @@ def inst_coll_manager(self) -> InstanceCollectionManager:

async def shutdown(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Needn't be this PR, but this should use an exit stack as well.

t.print_stack()
t.cancel()
if asyncio.all_tasks():
other_tasks = [t for t in asyncio.all_tasks() if t != asyncio.current_task()]
Copy link
Contributor

@daniel-goldstein daniel-goldstein Nov 2, 2023

Choose a reason for hiding this comment

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

I think this if is equivalent to what was there before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right. it was a different part of the stack trace that was throwing an almost identical error.

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

Successfully merging this pull request may close these issues.

[batch] workers have open tasks on shutting down
3 participants