fix(plugins): respect Settings > Query timeout in HTTP transports (#1267)#1271
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1267.
Root cause
Six HTTP-transport plugins hardcoded
URLSessionConfiguration.timeoutIntervalForRequest = 30(60 for BigQuery) at session creation. The user'sSettings > Query timeoutIS applied (DatabaseManager+Sessions.swift:104callsdriver.applyQueryTimeout(seconds)after connect, which sendsSET max_execution_time = Nfor ClickHouse), but the URLSession cancels the underlying HTTP request before the server can respond. The user seesNSURLErrorTimedOutinstead of the server'sCode: 159. Max execution time exceeded.TCP-transport plugins (MySQL, PostgreSQL, MSSQL, SQLite, DuckDB, Oracle, Cassandra, Redis, MongoDB) are unaffected because socket reads block indefinitely.
Fix
Added
HttpQueryTimeouttoTableProPluginKit(Sendable struct, no protocol changes, no ABI bump). Each HTTP plugin stores one under its existing lock, updates it inapplyQueryTimeout, and setsURLRequest.timeoutInterval = configured + 30s graceper request. The 30-second grace ensures the server-side limit fires first with a meaningful error.Also removed the
if timeoutSeconds > 0short-circuit at three host sites soSettings > Query timeout = 0("No limit") now reaches drivers and bounds the transport at the 1-hour resource ceiling instead of silently keeping the 30-second cap.Plugins changed
executeRaw/executeRawWithParamsat call site, not insidebuildRequest(kill RPC shares it and keeps its 5s ceiling)queryTimeoutfield alongside existing_queryTimeoutSeconds(polling math untouched)applyQueryTimeout; resource ceiling normalized 60s → 3600s (the old 60s silently truncated long Scan operations)applyQueryTimeoutapplyQueryTimeoutoverride in driver wrapperapplyQueryTimeoutoverride in driver wrapperABI strategy
No
currentPluginKitVersionbump. Adding a new public struct toTableProPluginKitdoesn't changePluginDatabaseDriver/DriverPluginwitness tables, so the five untouched registry plugins (MongoDB, Oracle, DuckDB, MSSQL, Cassandra) keep loading at version 12.The five touched registry plugins get
TableProMinAppVersion = "0.42.0"in theirInfo.plist, so an old TablePro build cleanly rejects a newly re-tagged plugin viaPluginManager.swift:380instead of risking a dyld symbol-not-found at runtime.Verification
xcodebuild ... build: BUILD SUCCEEDEDswiftlint lint --strict: 0 violations across 868 filesHttpQueryTimeoutTests: 8/8 passed (default + grace + zero + negative + clamp + statics + URLRequest assignment)Post-merge release flow
plugin-bigquery-v*,plugin-dynamodb-v*,plugin-etcd-v*,plugin-cloudflare-d1-v*,plugin-libsql-v*(CI fires once per multi-tag push, push one at a time).plugins.jsoninTableProApp/pluginswith newversion+downloadURL+ both archsha256for each.Out of scope
Settings > Query timeouton an open session. Today the help text says "Applied to new connections." and that stays accurate._queryTimeoutSeconds * 2retry budget): own bug, separate fix.Plan: velvety-bouncing-wand.md (local artifact; ask if you want the full text inline)
🤖 Generated with Claude Code