Skip to content

Fix ASYNC110 violation in edge3 worker#66955

Open
sanwar47 wants to merge 1 commit into
apache:mainfrom
break-through-19:fix/async110-edge3-worker
Open

Fix ASYNC110 violation in edge3 worker#66955
sanwar47 wants to merge 1 commit into
apache:mainfrom
break-through-19:fix/async110-edge3-worker

Conversation

@sanwar47
Copy link
Copy Markdown

The polling loop introduced in #66144 to wait for the supervisor process
to fully exit after grabbing results from the queue used the pattern
while job.is_running: await sleep(0.1).

This trips ruff's ASYNC110 rule (flake8-async: avoid await inside a
while-condition loop) and was causing the static-checks CI job to fail
on every open PR.

Fix: refactor to the equivalent while True / if not break form, which
is ASYNC110-clean and has identical runtime behaviour.

The polling loop that waits for the supervisor process to exit used:

    while job.is_running:
        await sleep(0.1)

This trips ruff ASYNC110 (await inside a while-condition loop).
Refactor to the ASYNC110-clean pattern used elsewhere:

    while True:
        if not job.is_running:
            break
        await sleep(0.1)

Same behaviour, passes static-checks CI.
@boring-cyborg boring-cyborg Bot added area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 labels May 14, 2026
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented May 14, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@jscheffl
Copy link
Copy Markdown
Contributor

The code has just been replaced by PR #65943 - nevertheless functionally the PR does not change but just models it in a way that RUFF does not complaint. It is not improving the polling busy loop at all. So a check violation exclusion would be preferred in my view.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants