[
https://issues.apache.org/jira/browse/SPARK-49133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kent Yao resolved SPARK-49133.
------------------------------
Fix Version/s: 4.2.0
Resolution: Fixed
Issue resolved by pull request 51849
[https://github.com/apache/spark/pull/51849]
> Make MemoryConsumer#used atomic to avoid deadlock
> -------------------------------------------------
>
> Key: SPARK-49133
> URL: https://issues.apache.org/jira/browse/SPARK-49133
> Project: Spark
> Issue Type: Improvement
> Components: Spark Core
> Affects Versions: 3.5.1
> Reporter: Hongze Zhang
> Assignee: Hongze Zhang
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.2.0
>
>
> MemoryConsumer doesn't provide internal thread-safety so user should add
> their own locking scope when it's used in multi-threaded environment.
> Thinking of multiple threads are allocating memory in the same task (although
> it's a special case regarding Spark's memory model), to protect the
> thread-safety of MemoryConsumer, user has to lock the API invocations of it.
> In this case, if one memory consumer spills another concurrently, there's a
> risk of ABBA deadlock. E.g., consumer A locks itself to acquire memory from
> task memory manager, while consumer B locks task memory manager then spills A.
> To fix this problem, Spark could ensure MemoryConsumer's thread-safety so
> user doesn't have to add their own lock in most cases.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]