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

gate: allow disabling max concurrent #6053

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

GiedriusS
Copy link
Member

Allow disabling max concurrency limit by setting limit to <= 0. Previously it was impossible to disable this limit.

Signed-off-by: Giedrius Statkevičius giedrius.statkevicius@vinted.com

Allow disabling max concurrency limit by setting limit to <= 0.
Previously it was impossible to disable this limit.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

I like this change, but I wonder if we should use 0 as the no-limit value? Or would it change the existing behavior in an incompatible way?

@GiedriusS
Copy link
Member Author

I doubt it makes much sense to set the limit to 0 as it is because it effectively disables everything 😄 what would be the use-case for that? 🤷

@fpetkovski
Copy link
Contributor

fpetkovski commented Jan 18, 2023

In Golang the zero value is usually used to indicate no limit, e.g. setting a timeout of 0 would mean no timeout etc.. Also as you pointed out, making the semantics of 0 equal to "don't allow any request" makes no sense. This is why I thought we can use 0 to disable the limit by instantiating a noop gate.

Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

Ok nevermind, I just noticed that this is already covered because the condition is <= :)

LGTM

@matej-g matej-g enabled auto-merge (squash) January 19, 2023 09:31
@matej-g matej-g merged commit e6df4f8 into thanos-io:main Jan 19, 2023
GiedriusS added a commit to vinted/thanos that referenced this pull request Jan 26, 2023
Allow disabling max concurrency limit by setting limit to <= 0.
Previously it was impossible to disable this limit.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Co-authored-by: Matej Gera <38492574+matej-g@users.noreply.github.com>
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
sshantel pushed a commit to sshantel/thanos that referenced this pull request Jan 28, 2023
Allow disabling max concurrency limit by setting limit to <= 0.
Previously it was impossible to disable this limit.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Co-authored-by: Matej Gera <38492574+matej-g@users.noreply.github.com>
ngraham20 pushed a commit to ngraham20/thanos that referenced this pull request Apr 17, 2023
Allow disabling max concurrency limit by setting limit to <= 0.
Previously it was impossible to disable this limit.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Co-authored-by: Matej Gera <38492574+matej-g@users.noreply.github.com>
ngraham20 pushed a commit to ngraham20/thanos that referenced this pull request Apr 17, 2023
Allow disabling max concurrency limit by setting limit to <= 0.
Previously it was impossible to disable this limit.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Co-authored-by: Matej Gera <38492574+matej-g@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants