Skip to content

Add configurable request timeout for the Airbyte API - #71092

Open
filipeaaoliveira wants to merge 2 commits into
apache:mainfrom
filipeaaoliveira:add-airbyte-api-timeout
Open

Add configurable request timeout for the Airbyte API#71092
filipeaaoliveira wants to merge 2 commits into
apache:mainfrom
filipeaaoliveira:add-airbyte-api-timeout

Conversation

@filipeaaoliveira

Copy link
Copy Markdown

Hello everyone.
While upgrading Airflow to 3.3.0 yesterday, our Airbyte DAGs started failing on every trigger even though the syncs themselves were starting in Airbyte.

The cause is the provider's move to airbyte-api 1.x, which replaced requests with httpx and with it picked up httpx's 5-second default request timeout. Provider 6.0.0 requires the 1.x SDK, but 5.5.1 hits it too: its airbyte-api>=0.52.0 pin has no upper bound (#69081 added the <1.0.0 cap after 5.5.1 shipped), and constraints-3.3.0 resolves it to airbyte-api==1.0.1.

On self-hosted deployments, job creation can take far longer than 5 seconds under load — we measured POST /v1/jobs at 30–130 seconds with 9 connections triggered in parallel. Every trigger task then fails with httpx.ReadTimeout raised from AirbyteHook.submit_sync_connection. And because create-job is not idempotent, the timed-out request still creates the job server-side, so retries get 409 "A sync is already running" and the attempt that eventually succeeds starts a duplicate sync.

The hook currently exposes no way to change the timeout. This PR lets users set it through an AirbyteHook parameter or a connection extra, passing it to the SDK's existing timeout_ms. With neither set, the session is built exactly as before, so default behavior is unchanged.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code - Fable 5 following the guidelines

Since apache-airflow-providers-airbyte 6.0.0 the provider uses
airbyte-api 1.x, which switched from requests to httpx and applies a
5-second default request timeout. On self-hosted Airbyte deployments
job creation can take far longer than that under load, so every
trigger fails - and because the create-job call is not idempotent, the
timed-out request still creates a job server-side, causing 409 errors
and duplicate syncs on retry. Allow users to raise the timeout via a
hook parameter or a connection extra.
@boring-cyborg

boring-cyborg Bot commented Aug 4, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant