-
Notifications
You must be signed in to change notification settings - Fork 65
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
calling list_accessible_customers with invalid refresh_token retries forever #246
calling list_accessible_customers with invalid refresh_token retries forever #246
Comments
Hi, I'm using the last version of the gem and I have the same problem too. |
I'll look into updating our retry defaults to something that might make more sense. In the meanwhile if you want, you can actually override these yourself by calling "configure" on the created service. See an example here: https://github.com/googleads/google-ads-ruby/blob/master/examples/misc/set_custom_client_timeouts.rb If you do mess around with this and find new defaults you like, let me know what they are so we can take that into account as we're looking into this. |
The problem here is what @yuichiro12 said, the "grpc_status" param of this error is 14 so it retries forever. Also I think updating code to 16 (Unauthenticated: The request does not have valid authentication credentials for the operation.) is the better option. |
I think part of the problem is that the API is returning the wrong code for this case. Case 14 (unavailable) is usually going to be a temporary API outage, and something that can be retried forever. Case 16 (unauthenticated) is something that you as the developer have to fix, and so shouldn't be retried at all. So in theory the library is actually behaving correctly, since it sees error code 14. We're going to look into why the wrong error code is getting returned, and if we can figure that out the library should simply start behaving correctly. In the meanwhile, we're going to look into updating how we handle error 14 (unavailable) so that there are a maximum number of retries, since getting an error message sooner will help people start to diagnose the problem, even if the error message is incorrect. |
This seems to be an intended GRPC behavior:
The reason for this behavior: On whether it's a bug in gapic-generator-ruby
On potential mitigation
I'll try to figure out if this impacts Cloud libraries as well. |
Any news about this issue? |
For now ended up with really quick and dirty workaround: Google::Ads::GoogleAds::V10::Services::GoogleAdsService::Client.configure do |c|
c.retry_policy = { initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [4] }
end Definetly looking for a better solution, but for noq it unleast doesn't lock background workers in infine loop |
Here's a link to the issue tracker for the underlying issue in the appropriate repo: googleapis/google-auth-library-ruby#366 If you're affected, consider adding a comment there so they can keep track of how widespread this issue is. |
This issue is still happening to me |
I urge anyone affected by this to comment on the issue in |
This was also happening to me, ended up solving by using the ruby begin
Timeout::timeout(10) do
client.service.customer.list_accessible_customers.resource_names
end
rescue Timeout::Error
# rescue logic happens here, if list_accessible_customers took >10 seconds
end |
Is there a way to determine what the actual error was if the timeout exception is triggered?
|
Hi, I called
list_accessible_customers
with invalid refresh_token:and I got this GRPC error:
Is this response supposed to be returned with code 14? I think code 16 (Unauthenticated) is desirable.
The problem is, GRPC response with code 14 are included in default
retry_policy
and it retries forever because of invalid refresh_token.See
retry_policy
defaults here:https://github.com/googleads/google-ads-ruby/blob/master/lib/google/ads/google_ads/v5/services/customer_service/client.rb#L67
Thanks.
The text was updated successfully, but these errors were encountered: