Skip to content

Edge worker maintenance state is remembered if worker crashes#50338

Merged
jscheffl merged 3 commits into
apache:mainfrom
boschglobal:bugfix/edge-maintenance-mode-on-shutdown
May 8, 2025
Merged

Edge worker maintenance state is remembered if worker crashes#50338
jscheffl merged 3 commits into
apache:mainfrom
boschglobal:bugfix/edge-maintenance-mode-on-shutdown

Conversation

@majorosdonat

Copy link
Copy Markdown
Contributor

If the worker is in maintenance mode, and crashes, or shut down NOT gracefully, then the state will remain in MAINTENANCE_MODE and later will be set to UNKNOWN by the executor. So in the end it will not be in OFFLINE_MAINTENANCE, which means, that during startup it will start normally instead of maintenance.
So 2 loigcs were modified to prevent this:

  1. The executor will not set to unknown if the dead worker's last state is maintenance, but to OFFLINE_MAINTENANCE.
  2. If the worker wants to register the STARTING state, but the previous state was maintenance or offline maintenance, then the state will remain maintenance

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@majorosdonat majorosdonat requested a review from jscheffl as a code owner May 8, 2025 09:05
@boring-cyborg boring-cyborg Bot added area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 labels May 8, 2025
@jscheffl jscheffl added kind:bug This is a clearly a bug type:bug-fix Changelog: Bug Fixes and removed kind:bug This is a clearly a bug labels May 8, 2025
Comment thread providers/edge3/src/airflow/providers/edge3/executors/edge_executor.py Outdated

@jscheffl jscheffl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants