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

   Stacked on top of #66402 (CHECKPOINTED state foundation). Adds the listener 
hook so plugin authors observe checkpoint events alongside running / success / 
failed / skipped:
   
   ```python
   @hookimpl
   def on_task_instance_checkpointed(previous_state, task_instance, 
checkpoint_data):
       ...
   ```
   
   The hook fires from `finalize()` when `run()` catches 
`AirflowTaskCheckpointed` and reports `CHECKPOINTED`. The operator-supplied 
`checkpoint_data` is delivered to the listener — payload-to-supervisor wiring 
is a separate question I left out of the foundation PR.
   
   Open to feedback on the `checkpoint_data` plumbing — currently stashed on 
the runtime ti in the catch block and read in finalize(), which works but is a 
bit hidden. The other shape would be a fourth return from `run()` or threading 
it through the supervisor message; happy to switch.
   
   ## Testing
   
   - New parametrized test `test_listener_receives_checkpoint_data` verifies 
the listener is called with the operator-supplied payload (None or dict).
   - The PR-66402 `test_run_returns_checkpointed_state` continues to cover the 
upstream state-transition contract.
   
   Marking draft because #66402 needs to merge first.


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