Skip to content

Fix pooled session cleanup and close races - #19288

Open
Caideyipi wants to merge 3 commits into
apache:masterfrom
Caideyipi:fix/table-session-close-lifecycle
Open

Caideyipi wants to merge 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.

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