By @lukebakken: Fix three stream argument validation bugs (backport #16285) (backport #16286)#16287
Merged
michaelklishin merged 5 commits intov4.2.xfrom May 2, 2026
Merged
Conversation
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)
(cherry picked from commit 66d09b7) # Conflicts: # deps/rabbit/Makefile
Author
|
Cherry-pick of 2c1ce46 has failed: Cherry-pick of 66d09b7 has failed: 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 |
25da2df to
053f64c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.