Skip to content

Conversation

@odesenfans
Copy link
Collaborator

Problem: resources are not cleaned up properly when the message websocket handler is cancelled. This is because aiohttp appears to raise a CancellationError.

Solution: use asyncio.shield() on the whole handler. Added a decorator to avoid splitting the implementation of shielded functions.
Protected the POST /messages endpoint as well as it also uses a message queue.

fix

Problem: resources are not cleaned up properly when the message
websocket handler is cancelled. This is because aiohttp appears
to raise a CancellationError.

Solution: use `asyncio.shield()` on the whole handler.
Added a decorator to avoid splitting the implementation of shielded
functions.
Protected the POST /messages endpoint as well as it also uses
a message queue.

fix
@odesenfans odesenfans force-pushed the od-shield-message-websocket branch from e2cd6be to 6ae5e0f Compare June 14, 2023 14:10
@odesenfans odesenfans merged commit 14c3b29 into master Jun 18, 2023
@odesenfans odesenfans deleted the od-shield-message-websocket branch June 18, 2023 15:38
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.

2 participants