Skip to content

Fix pooled session cleanup and close races - #19288

Merged
jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:fix/table-session-close-lifecycle
Nov 16, 2026
Merged

jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:fix/table-session-close-lifecycle

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

A table-session operation can fail while another thread calls close(). Without coordinated lifecycle handling, the failed connection can be returned to the pool while cleanup creates a replacement, exceeding the configured capacity.

This change serializes table-session operations with close, cleans up failed or unrestorable sessions, avoids returning connections after pool shutdown, and detaches result-set ownership before connection reuse. Regression coverage exercises close and RPC failures, state restoration, pool shutdown, and result-set reuse.

Validation:

  • mvn spotless:apply -P with-integration-tests -pl iotdb-client/session
  • Clean reactor SessionPoolCloseTest: 17 tests passed.

@jt2594838
jt2594838 merged commit 8b7cf27 into apache:master Nov 16, 2026
37 of 39 checks passed
Caideyipi added a commit that referenced this pull request Nov 16, 2026
* Fix pooled session and result-set cleanup

* Serialize table session lifecycle operations

* Make close concurrency test deterministic

(cherry picked from commit 8b7cf27)
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