1fanwang opened a new pull request, #72416: URL: https://github.com/apache/airflow/pull/72416
A synchronous OpenAI Batch task can keep running after its worker exits. A retry then submits another batch because its ID existed only in memory. Synchronous waits now persist the ID through `ResumableJobMixin`. Retries reconnect active or completed batches and resubmit only after failed, expired, or cancelled states. Deferrable and fire-and-forget paths are unchanged. Airflow versions before 3.3 keep legacy behavior and warn on explicit `durable`. ## Testing <details> <summary>Red regression and task-state retry proof</summary> ```console $ uv run --project providers/openai pytest providers/openai/tests/unit/openai/operators/test_openai.py -xvs E AssertionError: assert equals failed E -[None] E +['new_batch_id'] 1 failed, 9 passed $ E2E_MODE=legacy uv run --project providers/openai python dev/openai_e2e_dags/openai_resumable_e2e.py RuntimeError: simulated worker loss after batch submission mode=legacy state=success submissions=2 waits=2 stored_batch_id=None $ E2E_MODE=current uv run --project providers/openai python dev/openai_e2e_dags/openai_resumable_e2e.py RuntimeError: simulated worker loss after batch submission Reconnecting to existing job external_id=batch-1 external_id_key=openai_batch_id status=in_progress mode=current state=success submissions=1 waits=2 stored_batch_id=batch-1 ``` </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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
