You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/09/02 06:21:20 UTC

[PR] Reconnect Cloud Batch jobs on task retry [airflow]

1fanwang opened a new pull request, #72420:
URL: https://github.com/apache/airflow/pull/72420

   A synchronous Cloud Batch task uses a caller-stable job ID. If its worker exits after submission, retry resubmits the same ID and fails with `409 ... already exists`, even if the first job is active or succeeded.
   
   On Airflow 3.3+, the operator saves the canonical name before waiting. Retry fetches only that task-owned job: wait if active, restore success, resubmit after `NotFound`, or reject other terminal states. Fresh and deferrable execution, `durable=False`, and older Airflow behavior do not change.
   
   ## Testing
   
   The regression test drives the real task state accessor and `execute()` with a local hook stand-in.
   
   <details>
   <summary>Raw retry proof</summary>
   
   ```console
   $ AIRFLOW_HOME=.build/cloud-batch-proof-home uv run --project providers/google pytest providers/google/tests/unit/google/cloud/operators/test_cloud_batch.py::TestCloudBatchSubmitJobOperator::test_retry_reconnects_to_running_job -xvs
   
   # upstream/main
   E   google.api_core.exceptions.AlreadyExists: 409 Job projects/testproject/locations/us-central1/jobs/test already exists
   =================== 1 failed, 1 warning in 113.59s (0:01:53) ===================
   
   # this branch
   PASSED
   =================== 1 passed, 1 warning in 92.69s (0:01:32) ====================
   ```
   
   </details>
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (GitHub Copilot CLI, GPT-5.6 Sol)
   
   Generated-by: GitHub Copilot CLI (GPT-5.6 Sol) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reconnect Cloud Batch jobs on task retry [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #72420:
URL: https://github.com/apache/airflow/pull/72420#issuecomment-5839044979

   Hello @1fanwang - thank you for your contributions to Apache Airflow!
   
   The Airflow community has introduced a limit of **5 open pull requests at a time** for contributors without write access to the repository. You currently have 34 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
   
   * #66405 - Report failure causes and bound infrastructure replacements
   * #66781 - Honor AirflowFailException raised inside on_retry_callback
   * #66789 - Emit OpenTelemetry spans from airflow CLI entry points
   * #66790 - Preserve sensor start_date when scheduler advances reschedule to queued
   * #68955 - Reuse the resumable core for TriggerDagRunOperator's durable wait
   * #69135 - Let TriggerDagRunOperator own its execution via a new accessor
   * #70653 - Add resumable_job.reconnect_failure metric for failed reconnects
   * #71249 - Allow configuring the collation of asset name columns
   * #71258 - Fix task_instance_history downgrade failing under the PyMySQL driver
   * #71311 - Correct the retry_db_transaction docstring about provide_session
   * #71566 - Show worker pod logs for tasks that failed before writing any log
   * #72368 - Reconnect Synapse Spark batches on task retry
   * #72399 - Reconnect Azure Data Factory pipelines on task retry
   * #72400 - Prevent duplicate Anthropic batches on task retry
   * #72413 - Reconnect AWS Batch jobs after worker crashes
   * #72414 - Reconnect Airbyte sync jobs after task retries
   * #72415 - Reconnect Data Fusion pipelines after task retries
   * #72416 - Prevent duplicate OpenAI batches on task retry
   * #72417 - Recover Dataproc jobs after worker crashes
   * #72419 - Recover Athena queries after worker crashes
   * #72420 - Reconnect Cloud Batch jobs on task retry
   * #72421 - Prevent duplicate ECS submissions on task retry
   * #72422 - Recover Databricks SQL statements after task retries
   * #72423 - Reconnect dbt Cloud runs after worker crashes
   * #72927 - Restore missing serialized Dags without a full reparse
   * #73350 - Report task failure causes without changing retries
   
   These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
   
   * #68936 - Add durable option to TriggerDagRunOperator to reconnect on retry
   * #68952 - Let deferrable tasks reconnect without polling
   * #71307 - Retry transient database errors in the metastore secrets backend
   * #71522 - Return each attempt's own URL from operator extra links
   * #72907 - Return 404 instead of 500 when DagRun is missing in Execution API
   * #72908 - Edge: Return 404 for missing task logs and emit failed job metrics
   * #72925 - Edge: Return 400 instead of 500 on invalid worker version
   * #72926 - Return 404 for task-state writes after a Dag run is deleted
   
   This is **not** a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are.
   
   What we ask you to do is to make your **first prioritization decision**: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or `gh pr reopen <PR_NUMBER> --repo apache/airflow`. Reopen the ones you are ready to follow through - keep them rebased, respond to review comments and fix failing checks.
   
   While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack.
   
   Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reconnect Cloud Batch jobs on task retry [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #72420: Reconnect Cloud Batch jobs on task retry
URL: https://github.com/apache/airflow/pull/72420


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org