jason810496 commented on code in PR #74690:
URL: https://github.com/apache/airflow/pull/74690#discussion_r4333120653


##########
java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/Context.kt:
##########
@@ -127,6 +129,54 @@ data class Context(
   /** Registration of the executing task; resolves wired data inputs. */
   internal var taskDef: TaskDef? = null
 
+  // The value is read once, when the context is made. A context that read 
Cancellation.running on
+  // every call would stop seeing the stop request once the server sets the 
field back to null, for
+  // example in a shutdown hook.

Review Comment:
   Nit: the server sets the field back to null in the `finally` of 
`runTaskAndReport`, not in a shutdown hook.
   
   ```suggestion
     // The value is read once, when the context is made. The server sets 
Cancellation.running back to
     // null once it is done with the task, so a context that read the field on 
every call would stop
     // seeing the stop request in code that runs after that, such as a JVM 
shutdown hook.
   ```



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