googleapis / gax-ruby

Google API Extensions for Ruby
https://rubygems.org/gems/google-gax
BSD 3-Clause "New" or "Revised" License
20 stars 22 forks source link

Rewrite retry mechanism #150

Closed blowmage closed 5 years ago

blowmage commented 5 years ago

Rewrite retry mechanism by inspecting raised error only, no configuration.

jamesbrewerdev commented 5 years ago

@blowmage Can you provide some more details on what the plan is here? We use gax-ruby via google-cloud-spanner and have disabled the gax-ruby retry settings and handle retries and timeouts on our end. Will that still be possible with the current plan to not allow retry configuration in gax-ruby?

jbolinger commented 5 years ago

@leavingonaspaceship the plan is to remove the existing retry configuration and replace it with something simpler that gives the library users more direct control on how retrying works, if they want to use automatic retry at all. We'll definitely continue to allow it to be disabled.

If you think there's anything we could do better to support your particular use case, beyond disabling it, let us know and we'll see how we can help.

jamesbrewerdev commented 5 years ago

Gotcha. Does that mean we should be looking for changes in how google-cloud-spanner handles retrying after gax-ruby@2.0 is released?

The main problem we had with the way retrying is currently handled is that we couldn't instrument it at all. We couldn't tell the difference between a single 1-second latency vs. 4 0.25-second latencies. Errors like DeadlineExceededError were also swallowed (except in particularly bad cases of 60-second requests), so we couldn't see how often different errors were happening.

blowmage commented 5 years ago

It means that you will likely see changes to configuration in the future. Hopefully it will be an improvement. I don't think anyone know for sure if clients such as google-cloud-spanner will be 100% backwards compatible when on gax 2.0, so they may see a version bump as well. (Clients like Spanner are a challenge because they contain a public UI, but also the low-level generated code to access the API that is also public. So any change to the low level API code is right now technically public, and won't be backwards compatible when switching to gax 2.0.)

blowmage commented 5 years ago

@jbolinger Do you think this issue is satisfied by #172?

jbolinger commented 5 years ago

@blowmage yes.