Skip to content

Commit a8c22d5

Browse files
devin-ai-integration[bot]bot_apkfrifriSF59
authored
fix(destination-databricks): Add JDBC timeout configuration to prevent indefinite hangs (AI-Triage PR) (#74732)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: bot_apk <apk@cognition.ai> Co-authored-by: Francis Genet <francis.genet@airbyte.io>
1 parent c56b30e commit a8c22d5

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

airbyte-integrations/connectors/destination-databricks/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ data:
22
connectorSubtype: database
33
connectorType: destination
44
definitionId: 072d5540-f236-4294-ba7c-ade8fd918496
5-
dockerImageTag: 3.3.7
5+
dockerImageTag: 3.3.8
66
dockerRepository: airbyte/destination-databricks
77
githubIssueLabel: destination-databricks
88
icon: databricks.svg

airbyte-integrations/connectors/destination-databricks/src/main/kotlin/io/airbyte/integrations/destination/databricks/DatabricksConnectorClientsFactory.kt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ object DatabricksConnectorClientsFactory {
3535
return WorkspaceClient(config)
3636
}
3737

38+
// Socket timeout for JDBC read operations (seconds).
39+
// Large MERGE / T+D queries can legitimately run for tens of minutes, so we set a generous
40+
// ceiling. A value of 0 means "wait forever", which caused the 20+ hour hang in
41+
// https://github.com/airbytehq/oncall/issues/11610.
42+
private const val SOCKET_TIMEOUT_SECONDS = 3600
43+
44+
// Maximum time (seconds) the driver will retry connecting to a temporarily-unavailable
45+
// warehouse (e.g. auto-paused). Default is 0 (no retry). 300 s (5 min) allows time for
46+
// warehouse resume while still failing faster than the platform job deadline.
47+
private const val TEMPORARILY_UNAVAILABLE_RETRY_TIMEOUT_SECONDS = 300
48+
3849
fun createDataSource(config: DatabricksConnectorConfig): DataSource {
3950
val className = Driver::class.java.canonicalName
4051
Class.forName(className)
@@ -44,8 +55,18 @@ object DatabricksConnectorClientsFactory {
4455
// EnableArrow=0 flag is undocumented and disables ArrowBuf when reading data
4556
// Destinations only reads data for metadata or for comparison of actual data in tests. so
4657
// we don't need it to be optimized.
58+
//
59+
// SocketTimeout prevents indefinite hangs on long-running queries. See
60+
// https://kb.databricks.com/dbsql/
61+
// job-timeout-when-connecting-to-a-sql-endpoint-over-jdbc
62+
// TemporarilyUnavailableRetryTimeout caps the time the driver retries
63+
// connecting to a paused/resuming warehouse.
4764
val jdbcUrl =
48-
"jdbc:databricks://${config.hostname}:${config.port}/${config.database};transportMode=http;httpPath=${config.httpPath};EnableArrow=0"
65+
"jdbc:databricks://${config.hostname}:${config.port}/${config.database}" +
66+
";transportMode=http;httpPath=${config.httpPath};EnableArrow=0" +
67+
";SocketTimeout=$SOCKET_TIMEOUT_SECONDS" +
68+
";TemporarilyUnavailableRetryTimeout=" +
69+
"$TEMPORARILY_UNAVAILABLE_RETRY_TIMEOUT_SECONDS"
4970
when (config.authentication) {
5071
is BasicAuthentication -> {
5172
datasource.setURL(

docs/integrations/destinations/databricks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ This destination supports [namespaces](https://docs.airbyte.com/platform/using-a
9696

9797
| Version | Date | Pull Request | Subject |
9898
|:--------|:-----------|:--------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
99+
| 3.3.8 | 2026-03-11 | [74732](https://github.com/airbytehq/airbyte/pull/74732) | Add JDBC ConnectTimeout and SocketTimeout to prevent indefinite hangs when Databricks SQL warehouse is paused or unresponsive |
99100
| 3.3.7 | 2025-07-15 | [63311](https://github.com/airbytehq/airbyte/pull/63311) | Support arbitrary number of streams in findExisitngTable query |
100101
| 3.3.6 | 2025-03-24 | [56355](https://github.com/airbytehq/airbyte/pull/56355) | Upgrade to airbyte/java-connector-base:2.0.1 to be M4 compatible. |
101102
| 3.3.5 | 2025-03-07 | [55232](https://github.com/airbytehq/airbyte/pull/55232) | fix table name collision multiple connections same schema |

0 commit comments

Comments
 (0)