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: prevent cancellation of the message websocket #450

Merged
merged 1 commit into from
Jun 18, 2023

Conversation

odesenfans
Copy link
Contributor

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 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.

1 participant