Skip to content

Commit 4bebff1

Browse files
committed
Overload connection timeout property to avoid long query timeouts
Overload connection timeout property to avoid long query timeouts
1 parent 22f229d commit 4bebff1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## [Unreleased]
2+
- Fix an issue where long queries get an error before they complete
23

34
## [6.0.0] - 2025-01-10
45

drivers/starburst/src/metabase/driver/implementation/execute.clj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
[java-time :as t]
1919
[metabase.driver.implementation.sync :refer [starburst-type->base-type]]
2020
[metabase.driver.implementation.messages :as msg]
21+
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
2122
[metabase.driver.sql-jdbc.execute :as sql-jdbc.execute]
2223
[metabase.driver.sql.parameters.substitution :as sql.params.substitution]
2324
[metabase.query-processor.timezone :as qp.timezone]
@@ -70,6 +71,14 @@
7071
(throw e)))
7172
(f conn))))
7273

74+
(defmethod sql-jdbc.conn/data-warehouse-connection-pool-properties :starburst
75+
[driver database]
76+
;; In order to avoid Metabase from cancelling long queries, the
77+
;; unreturnedConnectionTimeout property needs to be updated
78+
(merge
79+
((get-method sql-jdbc.conn/data-warehouse-connection-pool-properties :sql-jdbc) driver database)
80+
{"unreturnedConnectionTimeout" 100000000000}))
81+
7382
;;; +----------------------------------------------------------------------------------------------------------------+
7483
;;; | Reading Columns from Result Set |
7584
;;; +----------------------------------------------------------------------------------------------------------------+

0 commit comments

Comments
 (0)