kalluripradeep commented on issue #60866:
URL: https://github.com/apache/airflow/issues/60866#issuecomment-3831335583

   I'd like to work on this issue.
   
   **Investigation:**
   
   I've reviewed the codebase and found:
   - Task-level retries use `try_number` and `max_tries` in TaskInstance
   - `TriggerDagRunOperator` with `reset_dag_run=True` clears tasks but has no 
retry counter
   - No DAG-level retry tracking exists in DagRun model
   
   **Proposed approach:**
   
   Add DAG-level retry fields to mirror task-level pattern:
   
   **1. DagRun model:**
   ```python
   dag_try_number: int (default 0)
   dag_max_tries: int (default -1)
   ```
   
   **2. DAG parameters:**
   ```python
   max_dag_retries: int = 0
   dag_retry_delay: timedelta | None = None
   ```
   
   **3. Retry logic:**
   On DAG failure, check `dag_try_number < dag_max_tries`. If yes, increment 
counter and clear/rerun. If no, mark failed.
   
   This prevents infinite loops and provides familiar API.


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