Skip to content

Fix oversized subscription requests with slicing - #18695

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/subscription-request-slicing
Open

Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/subscription-request-slicing

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Subscription requests could exceed the negotiated Thrift frame size. This change:

  • Slices oversized subscription request bodies using the smaller client/server frame limit, with 1 KiB reserved for RPC and slice metadata. The receiver validates ordering, metadata and total length before reassembling, with a bounded reassembly size.
  • Batches heartbeat and commit contexts by serialized size, then merges the responses. Commit batches reserve headroom for echoed contexts and progress in the response.
  • Keeps handshake and close unsliced because they control the connection lifecycle; an oversized one fails locally instead of sending an invalid frame.
  • Leaves requests that fit in one frame unchanged. A server must support the new SLICE request type before a client can send oversized requests to it.

Verification

  • Full reactor mvn test-compile -DskipTests, including -P with-zh-locale.
  • Targeted PipeSubscribeSliceReqTest, SubscriptionProviderSlicingTest, and SubscriptionReceiverV1Test: 26 tests passed.
  • Spotless, Checkstyle and git diff --check passed.

This PR has:

  • been self-reviewed.
  • added comments explaining non-obvious choices.
  • added unit tests for the new paths.

Key changed/added classes (or packages if there are too many classes) in this PR

PipeSubscribeSliceReq, PipeSubscribeSliceReqBuilder, PipeSubscribeSliceReqHandler, AbstractSubscriptionProvider, SubscriptionReceiverV1.

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.

1 participant