@@ -1009,6 +1009,15 @@ def setJobGroup(self, groupId, description, interruptOnCancel=False):
10091009 in Thread.interrupt() being called on the job's executor threads. This is useful to help
10101010 ensure that the tasks are actually stopped in a timely manner, but is off by default due
10111011 to HDFS-1208, where HDFS may respond to Thread.interrupt() by marking nodes as dead.
1012+
1013+ .. note:: Currently, setting a group ID (set to local properties) with a thread does
1014+ not properly work. Internally threads on PVM and JVM are not synced, and JVM thread
1015+ can be reused for multiple threads on PVM, which fails to isolate local properties
1016+ for each thread on PVM. To work around this, you can set `PYSPARK_PIN_THREAD` to
1017+ `'true'` (see SPARK-22340). However, note that it cannot inherit the local properties
1018+ from the parent thread although it isolates each thread on PVM and JVM with its own
1019+ local properties. To work around this, you should manually copy and set the local
1020+ properties from the parent thread to the child thread when you create another thread.
10121021 """
10131022 warnings .warn (
10141023 "Currently, setting a group ID (set to local properties) with a thread does "
@@ -1031,6 +1040,15 @@ def setLocalProperty(self, key, value):
10311040 """
10321041 Set a local property that affects jobs submitted from this thread, such as the
10331042 Spark fair scheduler pool.
1043+
1044+ .. note:: Currently, setting a local property with a thread does
1045+ not properly work. Internally threads on PVM and JVM are not synced, and JVM thread
1046+ can be reused for multiple threads on PVM, which fails to isolate local properties
1047+ for each thread on PVM. To work around this, you can set `PYSPARK_PIN_THREAD` to
1048+ `'true'` (see SPARK-22340). However, note that it cannot inherit the local properties
1049+ from the parent thread although it isolates each thread on PVM and JVM with its own
1050+ local properties. To work around this, you should manually copy and set the local
1051+ properties from the parent thread to the child thread when you create another thread.
10341052 """
10351053 warnings .warn (
10361054 "Currently, setting a local property with a thread does not properly work. "
@@ -1058,6 +1076,15 @@ def getLocalProperty(self, key):
10581076 def setJobDescription (self , value ):
10591077 """
10601078 Set a human readable description of the current job.
1079+
1080+ .. note:: Currently, setting a job description (set to local properties) with a thread does
1081+ not properly work. Internally threads on PVM and JVM are not synced, and JVM thread
1082+ can be reused for multiple threads on PVM, which fails to isolate local properties
1083+ for each thread on PVM. To work around this, you can set `PYSPARK_PIN_THREAD` to
1084+ `'true'` (see SPARK-22340). However, note that it cannot inherit the local properties
1085+ from the parent thread although it isolates each thread on PVM and JVM with its own
1086+ local properties. To work around this, you should manually copy and set the local
1087+ properties from the parent thread to the child thread when you create another thread.
10611088 """
10621089 warnings .warn (
10631090 "Currently, setting a job description (set to local properties) with a thread does "
0 commit comments