-
Notifications
You must be signed in to change notification settings - Fork 436
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
JSON body response is being truncated #537
Comments
Hello, Do you have the |
hi @Zapotek I have the same issue, here is my #response_headers, #return_code and #return_message
|
I'm getting this to and I think it's because easy_cleanup isn't being called. It seems like you're using Auto pointers to detect when the easy handle is no longer referenced https://github.com/typhoeus/ethon/blob/ab052b6a317309b6ae8be7b538738b138b11437a/lib/ethon/easy/operations.rb#L13 However, according to curl's docs (https://curl.haxx.se/libcurl/c/curl_easy_cleanup.html), easy_cleanup might invoke some progress callbacks, which I'm assuming is to deal with a race between multi_info_read saying your done and actually calling the write callback. The problem is you call easy.complete while still having a handle to to the easy handle https://github.com/typhoeus/ethon/blob/ab052b6a317309b6ae8be7b538738b138b11437a/lib/ethon/multi/operations.rb#L151 so the final bytes of a message might not get processed. I can try testing this with a PR in a couple hours when I have more time. |
D'oh. I poked at this and I don't think that's the issue :( But I am still seeing this bug. Response Headers:
With a 200 status. And the Response body is large since this is part of a scraping task |
I'm in a breakpoint where this happens right now and the easy.return_code in check is :recv_error. However, nothing seems to be actually caring about that. easy.log_inspect output:
It looks like https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/adapters/faraday.rb#L102 should also check if resp.return_code is anything but :ok. |
As for what's causing the :recv_error, the client is sending a RST ACK to the server to socket close isn't coming from the server. Not sure what's causing that yet |
Hello, I'm pulling a large amount of data while paginating through an API (250 records per page, about 500 pages per hour, Typhoeus max concurrent requests are 20). The first 20 min I'm able to receive json strings from
response.body
no problem. However, after that I get a truncated response, and thus without the closing braces of the JSON I'm not able to parse the string successfully.Any idea why this may be happening? I'm running this on a worker process, not web. I can provide more code if that would be helpful. Have tried both the latest version of Typhoeus at time of writing, as well as 0.5.0.
The text was updated successfully, but these errors were encountered: