Skip to content

By @lukebakken: Fix three stream argument validation bugs (backport #16285) (backport #16286)#16287

Merged
michaelklishin merged 5 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-16286
May 2, 2026
Merged

By @lukebakken: Fix three stream argument validation bugs (backport #16285) (backport #16286)#16287
michaelklishin merged 5 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-16286

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented May 2, 2026

This is #16284 by @lukebakken with a few tweaks and additional validation tests from me.

Closes #16282.


This is an automatic backport of pull request #16285 done by Mergify.
This is an automatic backport of pull request #16286 done by Mergify.

lukebakken and others added 4 commits May 2, 2026 05:46
Bug 1: `check_max_age` crashes on input with no leading digits
(e.g. "D"). The regex `[0-9]*` matches an empty string, then
`list_to_integer("")` raises `error:badarg` and crashes the
channel. Change to `[0-9]+` so the regex requires at least one
digit; non-matching input falls through to `{error, invalid_max_age}`.

Bug 2: `x-stream-filter-size-bytes` is listed in `declare_args()`
with a `check_non_neg_int_arg` validator but is missing from
`rabbit_stream_queue:capabilities().queue_arguments`. Since
`check_declare_arguments` only runs validators for args in both
lists, the type validator never runs. Add the arg to stream
capabilities.

Bug 3: `check_filter_size` compares `Val` against integer bounds
without a type guard. Erlang term ordering makes any binary
"greater than" any number, producing incorrect results for
non-integer values. Add a type guard clause that rejects
non-integer types. Also fix a double-space typo in the error
message.

Fixes #16282

(cherry picked from commit df231bf)
(cherry picked from commit 7b971ee)
References #16284.

(cherry picked from commit 9eb04af)
(cherry picked from commit 8035ebe)
(cherry picked from commit 03bf477)

# Conflicts:
#	deps/rabbit/Makefile
(cherry picked from commit 2c1ce46)

# Conflicts:
#	deps/rabbit/Makefile
(cherry picked from commit 66d09b7)

# Conflicts:
#	deps/rabbit/Makefile
@mergify mergify Bot added the conflicts label May 2, 2026
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented May 2, 2026

Cherry-pick of 2c1ce46 has failed:

On branch mergify/bp/v4.2.x/pr-16286
Your branch is ahead of 'origin/v4.2.x' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 2c1ce467f8.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deps/rabbit/Makefile

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 66d09b7 has failed:

On branch mergify/bp/v4.2.x/pr-16286
Your branch is ahead of 'origin/v4.2.x' by 3 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 66d09b7869.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deps/rabbit/Makefile

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@michaelklishin michaelklishin added this to the 4.2.7 milestone May 2, 2026
@mergify mergify Bot added the make label May 2, 2026
michaelklishin added a commit that referenced this pull request May 2, 2026
@michaelklishin michaelklishin force-pushed the mergify/bp/v4.2.x/pr-16286 branch from 25da2df to 053f64c Compare May 2, 2026 07:11
@michaelklishin michaelklishin merged commit d16dda1 into v4.2.x May 2, 2026
300 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-16286 branch May 2, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants