Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add retry logic in case of google auth refresh credential error #38961

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

dondaum
Copy link
Contributor

@dondaum dondaum commented Apr 12, 2024

Occasionally, acquire impersonated credentials can fail with a 502 HTTP (Server error). It raises a google.auth.exceptions.RefreshError. Using task retries is sometimes not a good option as, e.g. a submitted BigQuey query should not be submitted again.

The error occur in tasks running in deferred mode where acquiring impersonated credentials happens frequently every x seconds depending on the task's poll_interval.

In this case we should have some retry to acquire impersonated credentials.

Note: The deferable version of BigQueryInsertJobOperator is using the the synchronous client call with the event loop's run_in_executor() method. #35833

closes: #38532


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Apr 12, 2024
@dondaum dondaum marked this pull request as draft April 12, 2024 10:49
@dondaum dondaum force-pushed the fix/google-bigquery-refresh-error branch from 98933d1 to 0f506dd Compare April 15, 2024 07:13
@dondaum dondaum marked this pull request as ready for review April 15, 2024 08:22
@eladkal eladkal requested a review from Lee-W April 16, 2024 04:40
@dondaum dondaum force-pushed the fix/google-bigquery-refresh-error branch 2 times, most recently from 899a981 to ea616c4 Compare April 16, 2024 07:10
@dondaum dondaum requested a review from Lee-W April 16, 2024 07:27
@Lee-W
Copy link
Member

Lee-W commented Apr 21, 2024

I'm planning on merging this one later today. Please let me know if anyone wants to take a deeper look 🙂

@eladkal eladkal force-pushed the fix/google-bigquery-refresh-error branch from ea616c4 to 0e8566c Compare April 21, 2024 06:02
@eladkal eladkal merged commit 59084fd into apache:main Apr 21, 2024
41 checks passed
RodrigoGanancia pushed a commit to RodrigoGanancia/airflow that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQueryInsertJobOperator sometimes fails to acquire impersonated credentials when in deferred mode
4 participants