Skip to content

Add try clause to DataFusionHook.wait_for_pipeline_state - #10031

Merged
turbaszek merged 1 commit into
apache:masterfrom
PolideaInternal:add-try-to-datafusion-waiting
Aug 3, 2020
Merged

turbaszek merged 1 commit into
apache:masterfrom
PolideaInternal:add-try-to-datafusion-waiting

Conversation

@turbaszek

Copy link
Copy Markdown
Member

Sometimes it may happen that the pipeline is not visible instantly in
DataFusion so retrieving it will result in 404

closes: #10030


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

Sometimes it may happen that the pipeline is not visible instatntly in
DataFusion so retriving it will result in 404
closes: apache#10030
@boring-cyborg boring-cyborg Bot added the provider:google Google (including GCP) related issues label Jul 28, 2020
@turbaszek

Copy link
Copy Markdown
Member Author

Happy to see this as part of #10014

@olchas olchas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@turbaszek
turbaszek merged commit 27020f8 into apache:master Aug 3, 2020
@turbaszek
turbaszek deleted the add-try-to-datafusion-waiting branch August 3, 2020 08:54
shahar1 pushed a commit that referenced this pull request Sep 13, 2026
#72406)

#60688 changed `_check_response_status_and_data` to raise
`requests.exceptions.HTTPError` on a 404 instead of
`AirflowNotFoundException`, but the polling loop in
`DataFusionHook.wait_for_pipeline_state` was changed to catch `KeyError`
instead of `AirflowException`. The two no longer line up, so the 404 that
CDAP returns while a run is still being registered escapes the loop and
fails `CloudDataFusionStartPipelineOperator` immediately.

That 404 tolerance was added in #10031 for exactly this reason: right after
a pipeline is started, the run is not yet visible in the system.

Catch `HTTPError` alongside `KeyError` so the loop keeps polling. Only the
404 branch of `_check_response_status_and_data` raises `HTTPError` (any
other non-200 raises `RequestException`), so this stays narrow: real
failures still propagate.
xvega pushed a commit to xvega/airflow that referenced this pull request Sep 13, 2026
apache#72406)

apache#60688 changed `_check_response_status_and_data` to raise
`requests.exceptions.HTTPError` on a 404 instead of
`AirflowNotFoundException`, but the polling loop in
`DataFusionHook.wait_for_pipeline_state` was changed to catch `KeyError`
instead of `AirflowException`. The two no longer line up, so the 404 that
CDAP returns while a run is still being registered escapes the loop and
fails `CloudDataFusionStartPipelineOperator` immediately.

That 404 tolerance was added in apache#10031 for exactly this reason: right after
a pipeline is started, the run is not yet visible in the system.

Catch `HTTPError` alongside `KeyError` so the loop keeps polling. Only the
404 branch of `_check_response_status_and_data` raises `HTTPError` (any
other non-200 raises `RequestException`), so this stays narrow: real
failures still propagate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with CloudDataFusionStartPipelineOperator

3 participants