Skip to content
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

fix clusterRatelimit with more than one ratelimit instance #913

Merged
merged 2 commits into from Jan 25, 2019

Conversation

szuecs
Copy link
Member

@szuecs szuecs commented Jan 15, 2019

fix #903 clusterRatelimit with more than one ratelimit instance, which overwrote the shared data from other ratelimit instances.

Signed-off-by: Sandor Szücs sandor.szuecs@zalando.de

@szuecs szuecs requested a review from aryszka January 15, 2019 21:41
ratelimit/ratelimit.go Outdated Show resolved Hide resolved
@aryszka
Copy link
Contributor

aryszka commented Jan 16, 2019

👍

@aryszka
Copy link
Contributor

aryszka commented Jan 17, 2019

as we discussed the PR in its current form doesn't fully fix the problem

@aryszka
Copy link
Contributor

aryszka commented Jan 17, 2019

👎

@szuecs szuecs added wip work in progress do-not-merge labels Jan 18, 2019
@szuecs
Copy link
Member Author

szuecs commented Jan 22, 2019

After an internal discussion we agreed on having the implementation changed to #912 (comment) which enables full control of grouping ratelimiters across routes.
The user interface would get another option to set the group.

@szuecs szuecs force-pushed the fix/clusterRatelimit-multi-instances branch 2 times, most recently from 3e41f4f to b72a1c1 Compare January 22, 2019 21:11
@szuecs szuecs removed do-not-merge wip work in progress labels Jan 22, 2019
@szuecs
Copy link
Member Author

szuecs commented Jan 22, 2019

@aryszka the code was changed as discussed with internal customers and based on your comment #912 (comment).

If the code is good in the review and tested successfully in a dev cluster, I would fix all docs according to the implementation.

@szuecs szuecs force-pushed the fix/clusterRatelimit-multi-instances branch 2 times, most recently from 3f61594 to 00df64f Compare January 24, 2019 17:44
proxy/proxy.go Outdated

if rl.Allow(s) {
return settings, 0
allow = allow && rl.Allow(s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the allow var is not required. It could be just:

if !rl.Allow(s) {
    return setting, rl.RetryAfter(s)
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@aryszka
Copy link
Contributor

aryszka commented Jan 25, 2019

lgtm

please update the branch once #932 gets merged

feature: cluster ratelimit instances can now grouped
fix: cluster ratelimit instances do not override shared data anymore, based on the group the ratelimit data is stored in the swarm
fix: X-Forwarded-For Header Lookuper in cluster ratelimits is now treated similar to the default
refactor: rename file to make it more expressive
refactor: rename lb group eskip file
test: change test setup to have 2 different ratelimit groups

Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
@szuecs szuecs force-pushed the fix/clusterRatelimit-multi-instances branch from dd5cdd9 to c2023f5 Compare January 25, 2019 12:40
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
@aryszka
Copy link
Contributor

aryszka commented Jan 25, 2019

👍

1 similar comment
@szuecs
Copy link
Member Author

szuecs commented Jan 25, 2019

👍

@szuecs szuecs merged commit 84e014a into master Jan 25, 2019
@szuecs szuecs deleted the fix/clusterRatelimit-multi-instances branch January 25, 2019 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple Rate Limits for Same Backend are clashing
2 participants