-
Notifications
You must be signed in to change notification settings - Fork 876
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
Some requests (stream based) never ends and block the queue #371
Comments
have the same issue. the spider must have not only a timeout, but also a limit on the download volume |
Refer to my comment here: request/request#3341 |
Thanks @mike442144, but in this (crawling) context we can't blacklisted it before we face it. I still don't know how we can identify this type of connection in advance and complete it - Iam tried to send a OPTIONS request at first, but it did't helps to detect next GET request type. The most elegant solution in my opinion would be a some timeout, and 'response size limit' option that @slienceisgolden mentioned would be great (incl. other pitfalls: huge docs, files, other streams etc..). Currently not working on it, but it's still relevant. |
@Verhov Good idea to limit response body size, should work well in your case. Body size, also should be in the options for flexibility. Look forward to your merge request :) |
Summary:
I parsed millions of domains and faced issue what some stream based domain request can permanently block the queue.
Timeout in this case does not fired and RAM is constantly leaking.
I found two same domains: https://goldfm.nu/, https://rsradio.online/.
It's really nice radio 😄 but totally block my crawler pattern))
Current behavior
I'am using timeout but looks it not work pretty correctly, callback never fired in this case:
Issue
Definitely it because of this request starts media stream and node-crawler tried to get it all... request always in pending state.
Side issues
Also as stream is arriving it increase RAM and seem will thrown 'out of memory' exception.
Attempts to fix
I also tried to set accept header to html only, but it's doesn't have affect.
headers: { Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9' },
Currently I just skip this url as the special case, but I think it may not be unique case.
Expected behavior
Timeout should fire an error when we did not receive a response within the allotted time.
Related issues
This issue is definitely related with request package.
Question
Do you have any ideas how to resolve this case?)
The text was updated successfully, but these errors were encountered: