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
poll for jevdemon (twitter) regularly blows memory budget #525
Comments
This post has a relatively big inline data: image in it... http://www.evdemon.org/2015/learning-more-about-quill ... can't be the whole explanation, but I bet it isn't a coincidence |
holy crap, yes it does. 1MB! cc'ing @benwerd since i'm guessing he might want to cap the size of images he inlines into open graph tags like that. |
i was hoping i could give requests a response size limit so it would cut off and error out on big responses like this, but i didn't find an option like that. requests does let you read the raw response bytes, so i could implement it myself, but I'd rather not. :/ |
You could check the Content-Length header before calling Response.content; I do this in my webmention handler https://github.com/kylewm/redwind/blob/master/redwind/plugins/wm_receiver.py#L229 ... That at least helps mitigate well-behaved servers that accidentally send large data. |
ooh interesting, thanks! so requests only reads the full response body when you access /me heads off to RTFM... |
aha, you opt into lazily fetching the response body with (@kylewm looks like you'll probably want to add that to redwind's |
AAAARRGHH evdemon.org doesn't even give us |
@snarfed oy, I really need to learn how to read. |
heh, i guess you could use iter_content which is basically the same thing you said about dealing with raw bytes, but yeah i generally agree, would rather not. |
https://brid.gy/twitter/jevdemon . not sure why; his site http://www.evdemon.org/ runs known, and his other URL http://looselycoupledthinking.com/ just redirects to evdemon.org.
example log:
The text was updated successfully, but these errors were encountered: