-
Notifications
You must be signed in to change notification settings - Fork 50
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
bitbot disconnects finding the title of really large pages #328
Comments
deadline for slow transfers max file size for large files that could oom the bot don't know what problem you've managed to stumble on, but there's already code intended to handle what you've described. do you have a stacktrace? |
https://github.com/jesopo/bitbot/blob/4a6037c77405f3584efadc10ae75826b6b9ac422/src/utils/http.py#L35 it seems that the default for that variable is 100MiB, which probably doesn’t help for a page smaller than that, especially when the title probably isn’t very far into the file. i don’t have a stacktrace, this is tildebot that disconnected, so maybe ben has one, assuming it did crash? |
I'm sure the machine it's running on can read and parse 100mib of html unless it's somehow akin to a zipbomb. can you get the stacktrace from ben? we're going to be blind without it |
I think that limit ought to be configurable. Some people's stuff can handle that but others obviously can't. |
My guess is it spends forever in |
I've hit it with much worse in testing. eager to see a stacktrace |
if it is a timeout, especially on the |
benchmarking lxml against html5lib puts the former far ahead of the latter but I recall picking the latter for fault tolerances the former doesn't have |
looks like my log level was too low it just shut down |
This has been running for over 20 minutes... |
😰 |
I don't think the correct solution is limiting file size, I imagine it's trivial to code golf something html5lib finds hard to parse, I'd either deadline soupifying the results or switch to something closer to O(1). lxml is undoubtedly faster but I can't remember what exact case caused me to switch away from it |
Well I wanted to post the final count for timing html5lib for posterity but it seems python got OOM killed while I wasn't looking 🙁 |
when given a URI like https://git.causal.agency/scooper/tree/sqlite3.c?h=vendor-sqlite3 (a 24MiB page), bitbot disconnects while getting its title, probably because it tries to parse the entire page, just to find the title, leading to it timing out.
this could probably be fixed by limiting the amount of the page to be parsed to 64KiB or thereabouts.
The text was updated successfully, but these errors were encountered: