xupefei commented on code in PR #48906:
URL: https://github.com/apache/spark/pull/48906#discussion_r1851764566
##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -133,14 +133,34 @@ class SparkSession private(
/** Tag to mark all jobs owned by this session. */
private[sql] lazy val sessionJobTag = s"spark-session-$sessionUUID"
+ /**
+ * A UUID that is unique on the thread level. Used by managedJobTags to make
sure that a same
+ * tag from two threads does not overlap in the underlying
SparkContext/SQLExecution.
+ */
+ private[sql] lazy val threadUuid = new InheritableThreadLocal[String] {
+ override def childValue(parent: String): String = parent
+
+ override def initialValue(): String = UUID.randomUUID().toString
+ }
+
/**
* A map to hold the mapping from user-defined tags to the real tags
attached to Jobs.
- * Real tag have the current session ID attached: `"tag1" ->
s"spark-session-$sessionUUID-tag1"`.
+ * Real tag have the current session ID attached:
+ * tag1" -> s"spark-session-$sessionUUID-thread-$threadUuid-tag1
Review Comment:
Oops, Fixed!
--
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]