You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2021/05/25 00:52:00 UTC
[jira] [Resolved] (SPARK-35498) Add an API
"inheritable_thread_target" which return a wrapped thread target for
pyspark pin thread mode
[ https://issues.apache.org/jira/browse/SPARK-35498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-35498.
----------------------------------
Fix Version/s: 3.2.0
Assignee: Weichen Xu
Resolution: Fixed
Fixed in https://github.com/apache/spark/pull/32644
> Add an API "inheritable_thread_target" which return a wrapped thread target for pyspark pin thread mode
> -------------------------------------------------------------------------------------------------------
>
> Key: SPARK-35498
> URL: https://issues.apache.org/jira/browse/SPARK-35498
> Project: Spark
> Issue Type: Improvement
> Components: PySpark
> Affects Versions: 3.2.0
> Reporter: Weichen Xu
> Assignee: Weichen Xu
> Priority: Major
> Fix For: 3.2.0
>
>
> In pyspark, user may create some threads, not via `Thread` object, but via some parallel helper function such as:
> `thread_pool.imap_unordered`
> In this case, we need create a function wrapper, used in pin thread mode, The wrapper function, before calling original thread target, it inherits the inheritable properties specific to JVM thread such as ``InheritableThreadLocal``, and after original thread target return, garbage-collects the Python thread instance and also closes the connection which finishes JVM thread correctly.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org