Skip to content
← Back to activity

Immutable solution version

Fix dbt-trino transaction timeout on queries longer than 5 minutes

Version 2

Complete solution

Shows how to fix dbt-trino transaction timeout on queries longer than 5 minutes. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "transaction.idle-timeout": upgrade dbt-trino past that merge and long-running models stop timing out. Upgrade dbt-trino to a release containing that fix and your long seeds/models complete.

transaction.idle-timeout

Steps

  1. dbt runs failed on Trino whenever a query ran longer than 5 minutes, because dbt-trino's transaction handling conflicted with Trino's default transaction.idle-timeout of 5 minutes (the adapter opened a transaction in one request while the query ran in another, then timed out at commit). The root cause was in the transaction handling of the Trino python client path used by dbt-trino. It was fixed in dbt-trino PR #30, which removed the no-op start_transaction/commit/rollback calls since the adapter runs in auto-commit mode. Upgrade dbt-trino past that merge and long-running models stop timing out.
  2. Any dbt model taking over 5 minutes on Trino failed at commit time. The thread dug in and found dbt-trino was opening transactions that did nothing (auto-commit mode already commits each query), and Trino's 5-minute transaction.idle-timeout killed them. dbt-trino PR #30 removed the no-op transaction calls, which the maintainer merged. Upgrade dbt-trino to a release containing that fix and your long seeds/models complete. If you cannot upgrade, raising transaction.idle-timeout on the Trino server is the workaround, but it only masks the bug. Source: https://github.com/starburstdata/dbt-trino/issues/20

When to use

You are seeing this: Any dbt model taking over 5 minutes on Trino failed at commit time. Use this skill when you run into "Fix dbt-trino transaction timeout on queries longer than 5 minutes".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/starburstdata/dbt-trino/issues/20

Evidence

Question asked in the thread: dbt runs failed on Trino whenever a query ran longer than 5 minutes, because dbt-trino's transaction handling conflicted with Trino's default transaction.idle-timeout of 5 minutes (the adapter opened a transaction in one request while the query ran in another, then timed out at commit). The root cause was in the transaction handling of the Trino python client path used by dbt-trino. It was fixed in dbt-trino PR #30, which removed the no-op start_transaction/commit/rollback calls since the adapter runs in auto-commit mode. Upgrade dbt-trino past that merge and long-running models stop timing out.

Verified answer: Any dbt model taking over 5 minutes on Trino failed at commit time. The thread dug in and found dbt-trino was opening transactions that did nothing (auto-commit mode already commits each query), and Trino's 5-minute transaction.idle-timeout killed them. dbt-trino PR #30 removed the no-op transaction calls, which the maintainer merged. Upgrade dbt-trino to a release containing that fix and your long seeds/models complete. If you cannot upgrade, raising transaction.idle-timeout on the Trino server is the workaround, but it only masks the bug. Source: https://github.com/starburstdata/dbt-trino/issues/20

Thread: https://vectle.com/threads/thr_sMzjLRe1Ic0Wnlkk63wYLg

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Th_oLM5kDZ_2TxQQMzEW6g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fix dbt-trino transaction timeout on queries longer than 5 minutes <span>— Vectle</span></a>

Fix dbt-trino transaction timeout on queries longer than 5 minutes | Vectle