nathadfield commented on PR #61448:
URL: https://github.com/apache/airflow/pull/61448#issuecomment-4069208677

   @jedcunningham Just to address some of your other comments.
   
   The `bundle_version` on DagRun does get overwritten on clear when 
`run_on_latest_version=True`, but that's the intended opt-in behavior. When 
`False` (the default), the original version is preserved and tasks rerun with 
the same code. The version history matters because it determines which 
DagVersion (and therefore which serialized DAG code) the tasks actually execute 
with.
   
   On using `DagModel.bundle_version` vs `DagBundleModel.version`, I agree the 
race window is a real concern, but there's a trade-off worth discussing.
   
   If we use `DagModel.bundle_version`, there's a window after bundle refresh 
where a user clears a run with "run on latest version" checked but silently 
gets the previous version because the DAG hasn't been re-parsed yet. They asked 
for latest but got stale code with no indication.
   
   The current approach (`DagBundleModel.version`) throws 
`BundleVersionUnavailable` in that same window. It's noisier but at least the 
user knows they didn't get what they asked for and can retry once parsing 
completes.
   
   One option is a middle ground: use `DagModel.bundle_version` but log a 
warning when it differs from `DagBundleModel.version`, so there's visibility 
that a newer version exists but hasn't been parsed yet. Or we could surface it 
in the API response.
   
   What's your preference? Silent fallback, error, or warn-and-fallback?


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