ashb commented on code in PR #65932:
URL: https://github.com/apache/airflow/pull/65932#discussion_r3187631076


##########
airflow-core/docs/administration-and-deployment/cluster-policies.rst:
##########
@@ -37,10 +37,12 @@ There are three main types of cluster policy:
   task running in a DagRun. The ``task_policy`` defined is applied to all the 
task instances that will be
   executed in the future.
 * ``task_instance_mutation_hook``: Takes a 
:class:`~airflow.models.taskinstance.TaskInstance` parameter called
-  ``task_instance``. The ``task_instance_mutation_hook`` applies not to a task 
but to the instance of a task that
-  relates to a particular DagRun. It is executed in a "worker", not in the Dag 
file processor, just before the
-  task instance is executed. The policy is only applied to the currently 
executed run (i.e. instance) of that
-  task.
+  ``task_instance``. The ``task_instance_mutation_hook`` applies not to a task 
but to the instance of a task
+  that relates to a particular DagRun. It is executed scheduler-side, before 
the task instance is dispatched
+  to an executor; the worker does not invoke it. The hook may fire more than 
once for the same task instance
+  (on creation, on mapped expansion, on manual clear, and on natural retry 
transitions), so implementations
+  should be idempotent. Mutated ``TaskInstance`` fields are persisted and 
become the values used for dispatch

Review Comment:
   A lot of this isn't really accurate.
   
   Each retry would see a different ti.id column (it's a unique UUID per try 
for instance)



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