FrankYang0529 opened a new pull request, #74784:
URL: https://github.com/apache/airflow/pull/74784

   ### Why
   
   - On Airflow 3.3+ and edge3 3.8.0+ run executor callbacks, such as the 
`SyncCallback` of a Deadline Alert, on Edge workers. With the default `[edge] 
push_logs = True` the worker never reports whether the callback succeeded or 
failed.
   - The worker pushes the callback's log with the job key that the Edge 
executor builds for callbacks. That key has `dag_id="ExecuteCallback"`. The log 
route on the API server looks up a task instance for that key. No such task 
instance exists, so the route fails with HTTP 500. Even a callback whose code 
logs nothing leaves a non-empty log file, so the push fails for every callback.
   
   ### How
   
   - API server: for a callback job, the log route reads `log_path` from the 
workload JSON that the scheduler stored in the `command` column of the 
`edge_job` row. The worker reads the callback log from that same relative path. 
For a callback whose row or `log_path` is missing, both log routes return 404 
instead of 500.
   - Worker: pushing logs is now best effort. The worker logs an error from a 
push and still reports the final state. If pushes keep failing with 5xx, each 
push still waits for the client's retries, so the state can arrive a few 
minutes late. The worker change also handles an older API server that does not 
have the log route change above.
   
    <!-- SPDX-License-Identifier: Apache-2.0
         https://www.apache.org/licenses/LICENSE-2.0 -->
   
   <!--
   Thank you for contributing!
   
   Please provide above a brief description of the changes made in this pull 
request.
   Write a good git commit message following this guide: 
https://chris.beams.io/posts/git-commit/
   
   Please make sure that your code changes are covered with tests.
   And in case of new features or big changes remember to adjust the 
documentation.
   
   For user-facing UI changes, please attach before/after screenshots (or a 
short
   screen recording) so reviewers can assess the visual impact.
   
   Feel free to ping (in general) for the review if you do not see reaction for 
a few days
   (72 Hours is the minimum reaction time you can expect from volunteers) - we 
sometimes miss notifications.
   
   In case of an existing issue, reference it using one of the following:
   
   * closes: #ISSUE
   * related: #ISSUE
   -->
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, 
please
   change below checkbox to `[X]` followed by the name of the tool, uncomment 
the "Generated-by".
   -->
   
   - [X] Yes - Claude Code
   
   <!--
   Generated-by: [Tool Name] following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   -->
   
   


-- 
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]

Reply via email to