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

Add RateLimiter config property to enable limiting on specific nodes #236

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

hiteshk25
Copy link
Collaborator

  1. Added ratelimiter config property nodesEnabled
  2. App can set comma separated list of solr nodes to enable ratelimiter on those nodes only. Example "nodesEnabled": "localhost"

Copy link
Collaborator

@magibney magibney left a comment

Choose a reason for hiding this comment

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

This should work, though I'd prefer to consider this a temporary change, to be reverted and re-approached for, and backported from, upstream.

My only suggestion is not functional: I don't like overrideNodeProperty() as a method name; it's very opaque. Perhaps: maybeEnableForHost(String hostname)?

@magibney magibney changed the title Added suppost to enable rate limiter in nodes Add RateLimiter config property to enable specific nodes Oct 31, 2024
Copy link
Collaborator

@magibney magibney left a comment

Choose a reason for hiding this comment

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

This looks good now I think (again, provisionally, with the expectation that we'll revert and pursue similar upstream).

I edited the issue title to be more descriptive.

Comment on lines +79 to +80
if (!this.enabled && !hostname.isEmpty()) {
if (this.nodesEnabled != null && !this.nodesEnabled.isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there's no reason not to have these all as one if clause. Fine this way too, just a little unusual.

@magibney magibney changed the title Add RateLimiter config property to enable specific nodes Add RateLimiter config property to enable limiting on specific nodes Oct 31, 2024
@hiteshk25
Copy link
Collaborator Author

This looks good now I think (again, provisionally, with the expectation that we'll revert and pursue similar upstream).

I edited the issue title to be more descriptive.

Definitely, that should part of whole pluggable architecture proposal.

@hiteshk25 hiteshk25 merged commit b3d5916 into fs/branch_9_7 Nov 4, 2024
3 checks passed
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.

2 participants