You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/30 01:27:31 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #32399: [ML-14996][ML] Fix: After CrossValidator/TrainValidationSplit fit raised error, some backgroud threads may still continue run or launch new spark jobs

HyukjinKwon commented on a change in pull request #32399:
URL: https://github.com/apache/spark/pull/32399#discussion_r623525993



##########
File path: python/pyspark/util.py
##########
@@ -263,6 +264,46 @@ def _parse_memory(s):
     return int(float(s[:-1]) * units[s[-1].lower()])
 
 
+def _on_inheritable_thread_start():
+    from pyspark import SparkContext
+    sc = SparkContext._active_spark_context
+    if isinstance(sc._gateway, ClientServer):
+        # Here's when the pinned-thread mode (PYSPARK_PIN_THREAD) is on.
+        properties = sc._jsc.sc().getLocalProperties().clone()
+        sc._jsc.sc().setLocalProperties(properties)
+
+
+def _on_inheritable_thread_stop():

Review comment:
       Can we dedup the codes with `InheritableThread`?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org