Skip to content

[Bugfix] Reclaim RPC buffers by evicting idle clients - #18853

Merged
jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/rpc-buffer-pool-recovery
Oct 15, 2026
Merged

jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/rpc-buffer-pool-recovery

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Thrift client pools can retain RPC buffers sized for earlier large frames. Although idle clients already have a one-minute eviction threshold, Commons Pool checks only three objects per eviction run by default. Large pools can therefore retain expired connections and their buffers for much longer, leaving the server unable to allocate buffers for new connections.

This change makes each eviction run check every idle client across the pool and runs the sweep every 30 seconds. The existing one-minute idle threshold remains in place. Eviction closes the pooled transport and releases its read, write, and compression buffers; active clients are unaffected.

Validation

  • Added regression tests showing one eviction run removes all expired clients across multiple pool keys, preserves active and unexpired clients, and allows expired buffers to be reused.
  • Added real-socket tests with and without Snappy compression. After pool eviction, the server releases the closed connection's buffers and accepts a replacement connection.
  • mvn test -pl iotdb-core/node-commons -am -Dtest=ClientPoolIdleEvictionTest,ClientManagerTest,AutoResizingBufferTest -Dsurefire.failIfNoSpecifiedTests=false: passed.
  • mvn test-compile -DskipTests: passed.
  • mvn test-compile -DskipTests -P with-zh-locale: passed.

@Caideyipi Caideyipi changed the title [Bugfix] Reclaim idle RPC buffers when the shared pool is exhausted [Bugfix] Reclaim RPC buffers by evicting idle clients Oct 14, 2026
@jt2594838
jt2594838 merged commit 1b290ae into apache:master Oct 15, 2026
39 checks passed
@jt2594838
jt2594838 deleted the fix/rpc-buffer-pool-recovery branch October 15, 2026 03:07
jt2594838 pushed a commit that referenced this pull request Oct 15, 2026
* [Bugfix] Reclaim idle RPC buffers when the shared pool is exhausted

* [Bugfix] Evict idle RPC clients to release buffers

(cherry picked from commit 1b290ae)
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.

2 participants