Skip to content

Conversation

MauriceVanVeen
Copy link
Member

There were a bunch of stream and consumer settings that could be set to invalid values. A few examples include a MaxBytes of a large negative number, or stream Storage types that don't exist. There are no known cases where these are set wrongly by clients or the CLI, but it's generally better to have the server protect against invalid inputs.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner August 1, 2025 14:00
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/invalid-configs branch from 0c2f722 to 351452a Compare August 1, 2025 14:08
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/invalid-configs branch from 351452a to 52756c3 Compare August 1, 2025 16:07
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit a9a1410 into main Aug 4, 2025
69 of 70 checks passed
@neilalexander neilalexander deleted the maurice/invalid-configs branch August 4, 2025 10:14
if config.MaxWaiting < 0 {
config.MaxWaiting = 0
}
if config.MaxAckPending < 0 {

Choose a reason for hiding this comment

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

I'm currently working on the terraform provider and I think this has introduced a change in behaviour for us. If a consumer was created with max_ack_pending=-1 the value wasn't changed on creation. Now with it being set to 1000 a user of the provider will see drift in the resource that they're not expecting.

@ripienaar for visibility

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah these value changes should only happen when pedantic is false

neilalexander added a commit that referenced this pull request Aug 13, 2025
…ending -1 default (#7164)

Follow-up of #7134 based on
#7134 (comment)
and nats-io/jsm.go#693.

`max_ack_pending` should default to a minimum of -1. And add pedantic
handling to all minimums.

Also removes the `pedantic mode:` prefix in the pedantic error, because
it resulted in `pedantic mode: pedantic mode: {err}`, as the pedantic
error already adds the prefix.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
neilalexander added a commit that referenced this pull request Aug 20, 2025
Follow-up of #7134 and
#7164.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
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.

4 participants