Skip to content

[JDBC] Connection#close does not close the server session unless a catalog is set #1502

Open

Description

@AbhishekPathania

Describe the bug, including details regarding any error messages, version, and platform.

ArrowFlightSqlClientHandler#close sends CloseSession only when the connection was opened with the catalog property. Otherwise it just closes the gRPC channel, and the server is never told that the session is over.

Some Flight SQL servers create a session for every authenticated connection, without the client calling SetSessionOptions. Against such a server, every closed JDBC connection leaves its session open until it expires. With connection pools or frequent reconnects, this can use up the server's per-user session limit, after which new connections are rejected.

I expected Connection#close to send CloseSession whether or not catalog is set. When no catalog was set, a failure (for example UNIMPLEMENTED from a server without session support) should not make close throw.

ADBC's Flight SQL driver already does this: it always sends CloseSession on close and ignores an UNIMPLEMENTED reply (flightsql_connection.go).

Seen on 19.0.0 and on current main.

Activity

  1. added a commit that references this issue on Nov 18, 2026
  2. added this to the 20.0.0 milestone on Nov 18, 2026
  3. added 7 commits that reference this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions