airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Remove try_number shenanigans

Open dstandish opened this issue 1 year ago • 0 comments

Previously, there was a lot of bad stuff happening around try_number. We incremented it when task started running. And because of that, we had this logic to return "_try_number + 1" when task not running. And, since it was naively incremented when task starts running -- i.e. without regard to why it is running -- we decremented it when deferring or exiting on a reschedule.

What I do here is try to remove all of that stuff:

  • no more private _try_number attr
  • no more getter logic
  • no more decrementing
  • no more incrementing as part of task execution

Now what we do is increment only when the task is set to scheduled and only when it's not coming out of deferral or "up_for_reschedule".

dstandish avatar Apr 30 '24 21:04 dstandish