Skip to content

feat: Add connection-level query timeout support#5

Open
rovshan-b wants to merge 1 commit intomainfrom
feature/arrow-support-query-timeouts
Open

feat: Add connection-level query timeout support#5
rovshan-b wants to merge 1 commit intomainfrom
feature/arrow-support-query-timeouts

Conversation

@rovshan-b
Copy link
Copy Markdown

Query Timeout Support via x-query-timeout-ms gRPC Header

This change adds support for propagating query timeouts to the IOMETE Flight SQL server using a custom x-query-timeout-ms gRPC header. When a timeout is configured, the header is attached to every query execution request, allowing the server to enforce it server-side.

Statement-level timeout

Use the standard JDBC API on any Statement or PreparedStatement:

Statement stmt = connection.createStatement();
stmt.setQueryTimeout(30); // seconds
stmt.executeQuery("SELECT ...");

The header x-query-timeout-ms: 30000 will be sent with the request. A value of 0 means no timeout (default).

Connection-level (global) timeout

Set a default timeout for all queries on a connection via the JDBC URL or Properties:

jdbc:arrow-flight-sql://host:port?queryTimeout=60
Properties props = new Properties();
props.setProperty("queryTimeout", "60"); // seconds
Connection conn = DriverManager.getConnection(url, props);

All statements on this connection will include x-query-timeout-ms: 60000 unless overridden at the statement level.

Precedence

Statement-level timeout takes priority over the connection-level default. If setQueryTimeout(0) is called on a statement, it falls back to the connection-level value. If neither is set, no header is sent.

Configuration Header sent
stmt.setQueryTimeout(30) x-query-timeout-ms: 30000
?queryTimeout=60 (no statement timeout) x-query-timeout-ms: 60000
stmt.setQueryTimeout(30) + ?queryTimeout=60 x-query-timeout-ms: 30000
Neither configured (no header)

@rovshan-b rovshan-b changed the title feat: Add connection-level query timeout support and related tests feat: Add connection-level query timeout support Apr 27, 2026
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