Skip to content

Backport #19504: Fix RPC buffer accounting during transport and pipe shutdown - #19512

Open
Caideyipi wants to merge 1 commit into
dev/1.3from
codex/cp-c2ed594d-dev-1.3
Open

Caideyipi wants to merge 1 commit into
dev/1.3from
codex/cp-c2ed594d-dev-1.3

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Backport

Cherry-picks Apache IoTDB PR #19504 (source commit c2ed594d84a2db0c82984f4440dfebd047c4e53b) to dev/1.3.

Bug scenario

A DataNode count-point-processor worker can be using a cached IoTDBSyncClient inside TwoStageAggregateSender.request() when a leader change drops the Pipe task. Closing the sender may race with the in-flight RPC. Separately, a failed transport open can leave its eagerly reserved RPC buffer memory accounted.

Before this change, Pipe teardown could close the transport during an active transfer, and a failed connection setup could leave RPC buffer reservations charged. After this change, shutdown rejects new requests and defers cached-client cleanup until the active request exits; failed opens release their reservations, and clients that fail session setup are closed.

Validation

  • mvn spotless:apply -P with-integration-tests -pl iotdb-client/service-rpc,iotdb-core/datanode passed.
  • AutoResizingBufferTest: 36 tests passed.
  • TwoStageAggregateSenderTest: 2 tests passed with the default Surefire fork.
  • Full-reactor mvn test-compile -DskipTests passed for English and -P with-zh-locale.

@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Initial self-review of 0bb1f14f2d1e682d3c84b3e5be047c366d76916e against a9af9f2172bf240d00915f4ab4038eb1167df4a4 found no unresolved behavior or regression-test logic issues. No fixes beyond the target-branch compatibility adaptation were needed. AutoResizingBufferTest passed 36/36, TwoStageAggregateSenderTest passed 2/2 with the default Surefire fork, Spotless passed, and full-reactor English and Chinese test-compile both passed. An initial -DforkCount=0 test invocation failed due to Java 17 module-access configuration; it was rerun successfully with the default Surefire fork and is not counted as a pass.

@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

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