Skip to content

[Code scan] GDI sub-DAG polling treats queued runs as failures #137

Description

@njzjz

Source: Codex global repository scan of deepmodeling/dpti at commit b719828.
Project: DeepModeling Agent Code Scan

Problem
After triggering a sub-DAG, GDILoopSubDagController.wait_until_end() only treats success and running as non-failure states. Airflow DagRuns can legitimately be queued, scheduled, or briefly not visible immediately after trigger_dag(). The current polling loop raises AirflowFailException for these healthy transient states.

Code references

def wait_until_end(self):

elif dag_run_state == State.RUNNING:

raise AirflowFailException(f"subdag dag_run fail dag_id:{self.dag_name}; run_id:{self.run_id};")

c.trigger_dag(dag_id=self.dag_name, run_id=self.run_id,

Reproduction
Unit-test wait_until_end() with get_dag_run_state() returning State.QUEUED and then State.SUCCESS.

Expected result
Queued/scheduled/non-visible transient states should be polled until they become running/success/failure, instead of being treated as immediate failures.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions