dongjoon-hyun commented on code in PR #59663:
URL: https://github.com/apache/spark/pull/59663#discussion_r4339138574
##########
core/src/main/scala/org/apache/spark/TaskContextImpl.scala:
##########
@@ -518,3 +712,21 @@ private[spark] class TaskContextImpl(
}
}
}
+
+private object TaskContextImpl {
+
+ /** How an `invokeListeners()` call takes part in the listener invocation. */
+ sealed trait InvocationMode
+
+ /** Registers this thread as `listenerInvocationThread` unless another
thread is registered. */
Review Comment:
**10. [Nit] `Claim`'s doc and the JVM-wide lock note are imprecise**
`Claim` also returns without registering when this thread is the one
registered (L514-516), which "listener registers another listener (reentrancy)"
relies on. Maybe: "Registers this thread as `listenerInvocationThread` if no
thread is registered; otherwise leaves the listeners to the registered thread,
which may be this one."
Similarly, L490-492 names only `Task.kill`, but
`createResourceUninterruptibly` also applies a pending kill under
`TaskContext.synchronized` (L699-711), on the thread that creates the resource.
That can be a helper thread with the task's `TaskContext`, e.g.
`PythonRunner.scala:1577` or `PipedRDD.scala:140`. Could it say "on a thread
that applies a kill while holding the JVM-wide `TaskContext` lock (`Task.kill`,
or a pending kill in `createResourceUninterruptibly`)"?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]