Skip to content

Prevent Triggerer from crashing when a trigger event isn't serializable (#60152)#60981

Merged
dabla merged 1 commit intov3-1-testfrom
backport-60976-v3-1-test
Jan 24, 2026
Merged

Prevent Triggerer from crashing when a trigger event isn't serializable (#60152)#60981
dabla merged 1 commit intov3-1-testfrom
backport-60976-v3-1-test

Conversation

@dabla
Copy link
Contributor

@dabla dabla commented Jan 23, 2026

  • refactor: If asend in TriggerRunner comms decoder crashes due to NotImplementedError as a trigger event is not serializable, then retry without that event and cancel associated trigger

  • refactor: Applied some reformatting

  • refactor: Fixed some mypy issues

  • refactor: Fixed return type of send_changes method

  • refactor: Changed imports of trigger events

  • refactor: Reformatted trigger job runner

  • refactor: Fixed mocking of comms decoder

  • refactor: Forgot to add the patched supervisor_builder

  • refactor: Changed asserts in test_sync_state_to_supervisor

  • refactor: Refactored how state changes are validated

  • refactor: Validate events while creating the TriggerStateChanges message

  • refactor: Refactored try/except in validate_state_changes to keep mypy happy

  • Update airflow-core/src/airflow/jobs/triggerer_job_runner.py

Co-authored-by: Ash Berlin-Taylor ash_github@firemirror.com

  • refactor: Renamed validate_state_changes method to process_trigger_events

  • refactor: Only sanitize invalid trigger events if first attempt fails

  • refactor: Should check if msg.events is not None

  • refactor: Adapted test_sync_state_to_supervisor so both initial and retry call are correctly asserted and bad events are being sanitized


Co-authored-by: Ash Berlin-Taylor ash_github@firemirror.com

(cherry picked from commit 0238244)


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the 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) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@shahar1
Copy link
Contributor

shahar1 commented Jan 24, 2026

CI is not happy :(

@dabla dabla force-pushed the backport-60976-v3-1-test branch from 3cbc541 to 59f07da Compare January 24, 2026 10:51
@dabla
Copy link
Contributor Author

dabla commented Jan 24, 2026

CI is not happy :(

Yeah, but I know what I did wrong, it related to comms, I took change from 3.2, that won't work.

…le (#60152)

* refactor: If asend in TriggerRunner comms decoder crashes due to NotImplementedError as a trigger event is not serializable, then retry without that event and cancel associated trigger

* refactor: Applied some reformatting

* refactor: Fixed some mypy issues

* refactor: Fixed return type of send_changes method

* refactor: Changed imports of trigger events

* refactor: Reformatted trigger job runner

* refactor: Fixed mocking of comms decoder

* refactor: Forgot to add the patched supervisor_builder

* refactor: Changed asserts in test_sync_state_to_supervisor

* refactor: Refactored how state changes are validated

* refactor: Validate events while creating the TriggerStateChanges message

* refactor: Refactored try/except in validate_state_changes to keep mypy happy

* Update airflow-core/src/airflow/jobs/triggerer_job_runner.py

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>

* refactor: Renamed validate_state_changes method to process_trigger_events

* refactor: Only sanitize invalid trigger events if first attempt fails

* refactor: Should check if msg.events is not None

* refactor: Adapted test_sync_state_to_supervisor so both initial and retry call are correctly asserted and bad events are being sanitized

---------

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>

(cherry picked from commit 0238244)
@dabla dabla force-pushed the backport-60976-v3-1-test branch from 59f07da to 4c5d0ff Compare January 24, 2026 14:45
@dabla dabla merged commit 0167f87 into v3-1-test Jan 24, 2026
62 checks passed
@dabla dabla deleted the backport-60976-v3-1-test branch January 24, 2026 19:08
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Jan 27, 2026
@ephraimbuddy ephraimbuddy added this to the Airflow 3.1.7 milestone Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Triggerer type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants