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

fix: Replace asyncio.gather() with aiotools.PersistentTaskGroup() for kernel creation tasks #1129

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions changes/1129.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `BaseException` to the checklist to filter out `asyncio.CancelledError` raised during kernel creation process
2 changes: 1 addition & 1 deletion src/ai/backend/agent/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ async def create_kernels(
)
)
results = await asyncio.gather(*coros, return_exceptions=True)
errors = [*filter(lambda item: isinstance(item, Exception), results)]
errors = [*filter(lambda item: isinstance(item, (BaseException, Exception)), results)]
if errors:
# Raise up the first error.
if len(errors) == 1:
Expand Down