-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Websocket flow control is broken (deadlock+memory leak on websocket.receive) #1845
Comments
Has anyone been able to reproduce it yet? I hope I'm not crazy ) |
I will check in couple days |
Update: error may happen even on localhost connection, but probability is really low |
Update2: using uvloop doesn't help either (but it's faster, so failure rate is lower) |
I am planing to look into this problem before 2.1 release. Btw did you try aiohttp from master? |
Will try it right now, ETA ~15min ) |
Update: with aiohttp-master still hangs and leaks, pretty reliably |
Any news? 2.1 behaves the same. I really hope to look into it myself at the end of month, but kinda caught in the deadlines crossfire for now. |
Sorry, I didn't have enough time. Will try to look into this problem this week. |
@alexmnazarenko Could you test this issue with #1962? I've tested it and the MR seems to fix the issue in my machine. |
@pjknkda Works like a charm, tested it on multiple machines ) Thank you! |
@fafhrd91 Can we expect a release with this fix anytime soon? |
yes, but I'd like to check #1955 as well |
This seems to be security critical. Any idea of how long it takes to fix this? |
Everything is fixed, at least 3.2 has no such problems |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
Hello! I've ran into serious problem while implementing custom RPC over websockets (aiohttp on both sides). On a dense stream of larger messages consumer just freezes (while eating gigabytes of memory). Sender is "fine" (await ws.send_bytes() proceeds).
It seems to be correlated with message size, but I'm not sure. Surfaces randomly, but quite often on larger (64k+) messages. Who is client and who is server isn't important, so I'll stick to sender/consumer terms.
The problem manifested itself only in actual distributed test, if sender-consumer are both on localhost everything works fine.
Why do I think that issue is somewhere in flow control - the usecase was fine on older versions of aiohttp before it was implemented.
Any feedback is much appreciated )
Expected behaviour
Actual behaviour
await ws.receive
(orasync for msg in ws
) hangs at some point, memory grows to infinity and beyondSteps to reproduce
Original program was quite convoluted, so I've made a simple example reproducing the issue.
Consumer script (implemented as server):
Sender script (implemented as client):
Sender prints everything up to "Block 5000 sent". Consumer often, but not always stops somewhere much eariler (seen 293, 3097 - completely random).
Your environment
The text was updated successfully, but these errors were encountered: