-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: implement skipping backoff strategy #177
Conversation
tests/Unleash.Tests/Communication/UnleashApiClient_Features_Backoff_Tests.cs
Show resolved
Hide resolved
tests/Unleash.Tests/Communication/UnleashApiClient_Features_Backoff_Tests.cs
Outdated
Show resolved
Hide resolved
tests/Unleash.Tests/Communication/UnleashApiClient_Metrics_Backoff_Tests.cs
Outdated
Show resolved
Hide resolved
} | ||
|
||
[Test] | ||
public void Access_Error_Responses_Goes_Straight_To_Ten() |
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 looking at the test name, I don't see a check for responses == 10? Is that intentional? Am I reading the test wrong?
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.
Yeah can't check it directly, so there's a loop of 10 in there along with a check that call count hasn't increased as a result of that loop - indicating it went straight to skipping 10, and then the additional invocation that should be let through the skip check and increase call count by 1
…koff_Tests.cs Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
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.
Don't know the feature very well but overall I think this LGTM. I would probably wait for a review from someone who's actually implemented this one tho
…ckoff_Tests.cs Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
var client = GetClient(messageHandler); | ||
|
||
// Wind up call count to 10 | ||
for (var i = 0; i < 55; i++) |
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.
55?
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.
oh, right SUM(1..10) for the skips.
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.
Nice. Looks recognizable :)
Description
Implements a backoff strategy for metrics and features endpoints based on skipping scheduled polls/posts.
Specific failed request responses (401, 403, 404, 429, 500, 502, 503, 504) increases amount of requests to skip.
10 skips in a row is maximum.
401, 403, 404 cause the skip counter to increase to 10 immediately
Type of change
How Has This Been Tested?
Unit tests to provoke the behavior has been added
Checklist: