8000 Fix: prevent cancellation of the message websocket by odesenfans · Pull Request #450 · aleph-im/pyaleph · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: prevent cancellation of the message websocket #450

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

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

1 participant
0