googleads / google-api-ads-ruby

Ad Manager SOAP API Client Libraries for Ruby
297 stars 229 forks source link

Stream download freezes when date rate is large #151

Closed joethekurian closed 6 years ago

joethekurian commented 6 years ago

I'm using 'report_utils.get_stream_helper_with_awql' function to download 4 months 'keyword performance report' and write the data to DB. But after few seconds the download freezes.

But this works fine for a shorter date range of 7 days.

mcloonan commented 6 years ago

Thanks for letting us know. Can you provide any more specific detail about what you mean when you say "freezes"? Do you get an error message? Does the app just hang forever? Anything to help us start troubleshooting.

Thanks!

joethekurian commented 6 years ago

No error is thrown. It just hangs

joethekurian commented 6 years ago

Were you able to reproduce? In fact, it hangs even if I download 1-day data. (But not always)

mcloonan commented 6 years ago

Sorry for the delay; I have not had a chance to attempt to reproduce yet, unfortunately.

I wonder if it's having an issue because your processing is longer than it expects between yields (maybe causing a lost connection somewhere). This is just a guess, but try writing it to a file during the stream (which should be faster than writing to the database), and then you can copy the file to your database more slowly and the stream may not suffer for it.

Alternatively you can try to use one of the other non-streaming methods while this is still outstanding.

mcloonan commented 6 years ago

Closing this as we're not going to be able to fix it in this library. The Google Ads API has support for paging report results which alleviates this issue, so the long-term fix is to move to that API once it's fully launched.