FrankYang0529 commented on code in PR #75538:
URL: https://github.com/apache/airflow/pull/75538#discussion_r4490611791


##########
java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/Context.kt:
##########
@@ -127,10 +130,63 @@ data class Context(
   /** Registration of the executing task; resolves wired data inputs. */
   internal var taskDef: TaskDef? = null
 
+  // Only from() sets this field. A context made in any other way, including 
with copy(), keeps it null.
+  private var cancellation: Cancellation? = null

Review Comment:
   `Context` is a data class, so `copy()` passes only `dagRun` and `ti` to the 
constructor, and the constructor initializes the other fields again. The field 
that holds the `Cancellation` is not a constructor parameter. Before removing 
the static `Cancellation.running` from this PR, a copy saw a stop request, 
because the constructor set this field from `Cancellation.running`.
   
   If we want to fix this, we need to look the `Cancellation` up from somewhere 
global again. That brings back a form of the static `Cancellation.running`.
   



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