MyOwnClone / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
1 stars 0 forks source link

Change default behavior of Http request #369

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Num of tries (ConfigurableMessageHandler.NumTries) should be 2-3 (and NOT 10 
tries for a request)
2. BaseClientService.DefaultExponentialBackOffPolicy default value should 
UnsuccessfulResponse503. (we should also change UnsuccessfulResponse5xx enum 
value to UnsuccessfulResponse503)
3. BackOffHandler.MaxTimeSpan should be less than 5-8 seconds, and its 
DefaultHandleUnsuccessfulResponseFunc should be for status code = 503 (and NOT 
5xx)

Original issue reported on code.google.com by pele...@google.com on 6 Aug 2013 at 9:03

GoogleCodeExporter commented 9 years ago
https://codereview.appspot.com/12566043/

Original comment by pele...@google.com on 16 Aug 2013 at 2:08

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 16 Aug 2013 at 8:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Reason for this change:

10 tries -> 3 tries
We shouldn't try (again and again and again.... for 10 times). 
We want to fail fast, but not immediately. That's why 3 tries in total (with 
exponentail back-off it will take 3 additional seconds - first retry after 1 
second while the 2nd retry after another 2 seconds), is reasonable.

back-off behavior - from 5xx and exception to 503 only
We should not retry for 500 or 501 (Not Implemented). 
The right think to do is to retry when service is unavailable.
The user can change this behavior by changing the default behavior and add a 
new logic to retry. The user can of-course also change the number of tries.

Original comment by pele...@google.com on 19 Aug 2013 at 2:31