Skip to content

QQ: a delivery-limit of -1 disables the delivery limit. #12250

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

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

kjnilsson
Copy link
Contributor

For cases where users want to live a bit more dangerously this commit maps a delivery limit of -1 (or any negative value) such that it disables the delivery limit and restores the 3.13.x behaviour.

@kjnilsson kjnilsson added this to the 4.0.0 milestone Sep 9, 2024
@kjnilsson kjnilsson marked this pull request as ready for review September 9, 2024 13:01
@ansd ansd self-requested a review September 9, 2024 13:43
Copy link
Member

@ansd ansd left a comment

Choose a reason for hiding this comment

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

If an operator wants to enforce a maximum delivery-limit (e.g. by setting an operator policy with delivery-limit=5), a client app can now disable the delivery limit completely:

Screenshot 2024-09-09 at 15 47 38

I don't think this is what we want?

@michaelklishin
Copy link
Collaborator

michaelklishin commented Sep 9, 2024

@ansd you are right, for this setting from now on we should simply pick the operator policy value and not the lower or higher one. So, we need to tweak the resolving function.

@kjnilsson
Copy link
Contributor Author

@ansd you are right, for this setting from now on we should simply pick the operator policy value and not the lower or higher one. So, we need to tweak the resolving function.

unfortunately it isn't a simple as that as the policy resolution code doesn't include queue arg values. i'd have to add some code to a do a resolution based on all of queue arg, policy and operator policy.

Alternatively we treat all values above some limit, say 65535, as unlimited rather than special casing -1. In this case the current resolution logic would work fine.

@kjnilsson
Copy link
Contributor Author

Alt we could just say that any policy would override the queue arg if the queue arg is negative.

@michaelklishin
Copy link
Collaborator

@kjnilsson I like the idea with values above the (2^16-1) being treated as "unlimited". Because that's what the user who'd set it to, say, 100K, would arguably want.

@ansd
Copy link
Member

ansd commented Sep 10, 2024

Alt we could just say that any policy would override the queue arg if the queue arg is negative.

Yes, I think the "more conservative" value should always win for (x-)delivery-limit where "more conservative" means lower value except for -1 which means "unlimited".

Examples:

  1. Queue argument = -1, Policy = 5 should result in 5
  2. Queue argument = 5, Policy = -1 should result in 5
  3. Queue argument = -1, Policy = -1, Operator Policy = 5 should result in 5
  4. Queue argument = 0, Policy = -1, Operator Policy = -1 should result in 0

This allows operators to set guardrails via operator policies while applications can optionally choose a more conservative setting.

In addition, this resolution strategy won't break applications upgrading from 3.13 to 4.0.

For cases where users want to live a bit more dangerously this commit
maps a delivery limit of -1 (or any negative value) such that it
disables the delivery limit and restores the 3.13.x behaviour.
@kjnilsson kjnilsson force-pushed the delivery-limit-disable branch from 67b9939 to e81feb5 Compare September 10, 2024 09:48
@kjnilsson
Copy link
Contributor Author

Yes, I think the "more conservative" value should always win for (x-)delivery-limit where "more conservative" means lower value except for -1 which means "unlimited".

I went with this approach in the end. -1 isn't without precedence as means of turning some facility off so in this sense it maybe less surprising.

To mention that the default can be set to unlimited if the delivery-limit
is set to -1.
@michaelklishin michaelklishin merged commit 0c2e589 into main Sep 10, 2024
199 checks passed
@michaelklishin michaelklishin deleted the delivery-limit-disable branch September 10, 2024 14:01
michaelklishin added a commit that referenced this pull request Sep 10, 2024
QQ: a delivery-limit of -1 disables the delivery limit. (backport #12250)
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.

3 participants