Skip to content

Fix replay history size validation#4306

Open
DragonFSKY wants to merge 1 commit into
reactor:mainfrom
DragonFSKY:fix-4274-validate-history-size
Open

Fix replay history size validation#4306
DragonFSKY wants to merge 1 commit into
reactor:mainfrom
DragonFSKY:fix-4274-validate-history-size

Conversation

@DragonFSKY

@DragonFSKY DragonFSKY commented Jul 1, 2026

Copy link
Copy Markdown

Invalid replay history sizes and replay-all batch sizes are now rejected up front with IllegalArgumentException, rather than allowing low-level arithmetic or array-size failures to surface from replay buffer internals.

This validates the shared replay processor creation path for invalid historySize values, and validates Sinks.many().replay().all(int) / Sinks.unsafe().many().replay().all(int) batch sizes before constructing the underlying replay buffers. Existing behavior for valid arguments is unchanged; invalid arguments now fail earlier and consistently with IllegalArgumentException, including Integer.MAX_VALUE values that would overflow replay linked-array sizing.

Fixes #4274.

Testing:

  • ./gradlew :reactor-core:test --tests reactor.core.publisher.SinksTest --tests reactor.core.publisher.SinkManyReplayProcessorTest spotlessCheck -PspotlessFrom=origin/main --no-daemon
  • ./gradlew check -PspotlessFrom=origin/main --no-daemon
  • git diff --check origin/main...HEAD

Breaking changes: None for valid inputs.

Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
@DragonFSKY
DragonFSKY marked this pull request as ready for review July 2, 2026 04:05
@DragonFSKY
DragonFSKY requested a review from a team as a code owner July 2, 2026 04:05
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.

Validate historySize in SinkManyReplayProcessor#create(int, boolean)

1 participant