Skip to content

deploy-pipelines bounds every chunk with a fixed 2-minute deadline that a chunk of 20 cannot meet #32004

Closed

Description

@Khairajani

Affected module

Backend — openmetadata-ops CLI (OpenMetadataOperations.deployPipelines).

Describe the bug

deploy-pipelines POSTs chunks of pipeline IDs to POST /v1/services/ingestionPipelines/bulk/deploy, which deploys them sequentially. The client bounds each request with a hardcoded deadline:

int chunkSize = 20;
...
.timeout(Duration.ofMinutes(2))

That budgets 6 seconds per pipeline. Real per-pipeline deploy latency is 10–24s, so a full chunk cannot finish in time. Neither value is configurable — the command declares no options, so deployPipelinesConfig.additionalArgs has nothing to pass.

A client deadline does not cancel the server, so it fires on work that is succeeding: the chunk keeps deploying while the command marks all 20 pipelines FAILED and exits 1. Under restartPolicy: OnFailure the pod then replays the run on top of work still in flight.

Seen on a 92-pipeline instance during a version upgrade — the command reported failure with 90 of 92 pipelines deployed:

Processing chunk 1 of 5 (pipelines 1-20)
Failed to deploy pipeline chunk
java.net.http.HttpTimeoutException: request timed out
    at org.openmetadata.service.util.OpenMetadataOperations.deployPipelineChunk(OpenMetadataOperations.java:3040)

Because the budget is a constant rather than a function of chunk size, it tightens silently as a catalog grows — that instance was 63 pipelines a few months earlier.

To Reproduce

Run openmetadata-ops deploy-pipelines on an Airflow-backed instance with enough pipelines that a chunk of 20 exceeds two minutes. The per-pipeline latency behind it can be measured without the CLI by POSTing single-element chunks to bulk/deploy.

Measured

OpenMetadata 2.0.0, platform Airflow (3.3.0), ~100 ingestion pipelines. Sequential redeploys through bulk/deploy:

call elapsed
single-pipeline chunk, 1st 10.68s
2nd 13.12s
3rd 15.29s
chunk of 5 no response before the ingress 60s idle cap
single-pipeline chunk, after the above 23.94s

Every value exceeds the old 6.0s/pipeline budget — a chunk of 20 needs at least 20 x 10.68 = 214s, so it could not have fit in 120s even at best-case latency on an idle server. The cost is per-pipeline rather than amortized across a chunk (the chunk of 5 returned nothing by 60s while singles return in 10–15s), and it climbs as load accumulates.

Expected behavior

The deadline should scale with the work in a chunk — budgeted per pipeline, multiplied by the chunk size — instead of being a fixed constant, and both values should be settable from a deployment configuration.

Out of scope here (worth separate issues)

  • A legitimately expired deadline still records the whole chunk FAILED and exits 1. The persisted deployed flag cannot correct it: the deploy path only ever calls setDeployed(true), so it records whether a pipeline was ever deployed, not what this run did.
  • deployPipelineChunk swallows the timeout, so the next chunk is POSTed while the previous may still be running server side. A proper fix needs an async endpoint (202 + job handle + poll).
  • The per-pipeline latency itself, below.

Version

The affected code is identical on main, 2.0.0-release, 1.13 and 1.13.4-release. Measured on 2.0.0 with Airflow 3.3.0.

Additional context — why a single deploy costs 10–24s (separate fix)

get_dagbag() in openmetadata_managed_apis/api/utils.py drops read_dags_from_db=True for Airflow >= 3.0.0. Since DagBag.collect_dags() starts with if self.read_dags_from_db: return, a deploy on Airflow 2.x did zero file parses and read DAGs from the serialized-DAG table; on Airflow 3.x it walks the entire DAG folder on every deploy, and refresh_session_dag additionally forks an unjoined DagFileProcessorManager that parses it again. Deploy cost becomes O(total DAGs), and a full run O(N²) — which is why an instance can be fine at 63 pipelines and not at 92.

Related: #28500 (Airflow 3 DagContext race in build_dag, fixed in #28744) is a different layer — a DAG-parse crash in the pipeline service, not a client deadline in the ops CLI.

Activity

  1. self-assigned this
    on Aug 25, 2026
  2. moved this to In Progress 🏗️ in Shippingon Aug 25, 2026
  3. changed the title [-]deploy-pipelines marks a whole chunk FAILED and exits 1 when its fixed 2-minute client deadline expires while the server is still deploying[/-] [+]deploy-pipelines bounds every chunk with a fixed 2-minute deadline that a chunk of 20 cannot meet[/+] on Aug 25, 2026
  4. Khairajani commented on Aug 25, 2026

    @Khairajani
    ContributorAuthor

    Related: the underlying per-pipeline deploy latency that trips this deadline is tracked in #32006, with a fix in #32005.

    That is the get_dagbag() whole-folder DAG parse — on Airflow 3 a deploy walks every DAG file in the deployment, so deploy cost is O(total DAGs) and a bulk deploy O(total DAGs²). It is what makes the measurements above exceed the 120s / 20 = 6.0s per-pipeline budget.

    The two are independent: #31976 keeps this command from misreporting a chunk that is still progressing, #32005 removes the reason a chunk takes long enough to trip the deadline. Either can land first.

  5. moved this from In Progress 🏗️ to Done ✅ in Shippingon Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done ✅
  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions