-
Notifications
You must be signed in to change notification settings - Fork 447
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
Added request options for DataSource retry info #970
Conversation
@@ -17,7 +17,7 @@ module.exports = function setRequestCycle(model, observer, groups, | |||
var requestedPaths = requestedAndOptimizedPaths.requestedPaths; | |||
|
|||
// we have exceeded the maximum retry limit. | |||
if (count === model._maxRetries) { | |||
if (count > model._maxRetries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking considering the original comparison logic, should this be >=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change to align the retry counts with getRequestCycle
; one started at 0, the other at 1. Now they both start at 1, which lines up better with the Zuul retry header value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the one question posed, LGTM.
@@ -84,7 +84,7 @@ SetResponse.prototype._subscribe = function _subscribe(observer) { | |||
|
|||
// Starts the async request cycle. | |||
return setRequestCycle( | |||
model, observer, groups, isJSONGraph, isProgressive, 0); | |||
model, observer, groups, isJSONGraph, isProgressive, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tquetano-netflix The initial value was changed here, in coordination with the retry logic condition.
We can always use an object again if additional parameters become necessary.
4616363
to
c540f75
Compare
The DataSource for a Model has no insight into the retry mechanism for get and set requests. This PR adds the retry count as one of a set of request options that are passed to
DataSource.get
andDataSource.set
, so that this information may be used to e.g. manage request balancing and load shedding on the underlying network resource.