Skip to content

Starrocks db connection close - #141

Merged
Nitin Bhakar (nitinbhakar) merged 1 commit into
mainfrom
Starrocks-db-connection-close
Aug 27, 2026
Merged

Starrocks db connection close#141
Nitin Bhakar (nitinbhakar) merged 1 commit into
mainfrom
Starrocks-db-connection-close

Conversation

@nitinbhakar

@nitinbhakar Nitin Bhakar (nitinbhakar) commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Closing the gRPC client was not enough: StarRocks keeps the FE Flight SQL session in its token cache (visible in SHOW PROCESSLIST) until CloseSession is sent with the handshake bearer token, or until wait_timeout (default 8h).
  • closeFlightClient now sends CloseSession with that token, then closes the gRPC connection. Same path for job cleanup and health checks.
  • Also closes the client if authentication fails, so a half-open socket is not left behind.

Test plan

  • Run a StarRocks query through Heimdall and confirm the FE session disappears from SHOW PROCESSLIST immediately after the job finishes (not after 8h).
  • Confirm health checks do not leave sessions behind.
  • Confirm a failed auth attempt does not leak a gRPC connection.
  • Confirm a cancelled/timed-out job still closes the session (cleanup uses a 5s independent timeout, not the job context).

@nitinbhakar
Nitin Bhakar (nitinbhakar) merged commit 4400a32 into main Aug 27, 2026
7 checks passed
@nitinbhakar
Nitin Bhakar (nitinbhakar) deleted the Starrocks-db-connection-close branch August 27, 2026 16:04
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