-
Notifications
You must be signed in to change notification settings - Fork 16
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
ValueError when server event is bigger than 128kbytes #11
Comments
@awarecan could you please take a look at this issue? I've attached a simple workaround. Do you think it can be used? |
I don't like to rewrite the aiohttp stream function just for a corner case, why the monkey patch wasn't working? |
Thank you for your reply. import aiohttp
aiohttp.streams.DEFAULT_LIMIT = 10 * aiohttp.streams.DEFAULT_LIMIT
from aiohttp.client import ClientResponse
from aiohttp_sse_client import client as sse_client I am not sure, how to properly monkey patch the |
Hi @awarecan. I would disagree that it is a corner case. I'm having a similar issue while reading json streams. I also tried to monkey patch in the same way, but it doesn't seem to have any effect. The only solution i found is: s = response.content
s._high_water = 2 ** 18 That doesn't look very neat, and it would be great to have a parameter to choose iterator or change the limit. |
It has been resolved by aio-libs/aiohttp#5065 A EventSource(url, read_bufsize=2**18) |
Description
When the Server sends an event that is bigger than ~128kbytes aiohttp throws a ValueError because the line buffer is not big enough.
What I Did
Received an event that is bigger than 128kbytes
client.py
Exisiting Issues
spacemanspiff2007/HABApp#118
aio-libs/aiohttp#4453
Suggested Workaround:
https://github.com/zalando-incubator/kopf/pull/276/files
The text was updated successfully, but these errors were encountered: