You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Kousuke Saruta (Jira)" <ji...@apache.org> on 2025/10/29 10:28:00 UTC

[jira] [Updated] (SPARK-53807) Fix a race condition issue between `unlock` and `releaseAllLocksForTask` in `BlockInfoManager for write locks

     [ https://issues.apache.org/jira/browse/SPARK-53807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kousuke Saruta updated SPARK-53807:
-----------------------------------
    Labels: pull-request-available  (was: )

> Fix a race condition issue between `unlock` and `releaseAllLocksForTask` in `BlockInfoManager for write locks
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-53807
>                 URL: https://issues.apache.org/jira/browse/SPARK-53807
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Block Manager, Spark Core
>    Affects Versions: 4.1.0
>            Reporter: Kousuke Saruta
>            Priority: Major
>              Labels: pull-request-available
>
> When `unlock` and `releaseAllLocksForTask` try to release the same lock for a task, assertion error can happen.
> This issue can be reproduced by adding following test into `BlockInfoManagerSuite`.
> {code}
>     val blockId = TestBlockId("block")
>     assert(blockInfoManager.lockNewBlockForWriting(blockId, newBlockInfo()))
>     blockInfoManager.unlock(blockId)
>     // Without the fix the block below almost always fails.
>     (0 to 10).foreach { task =>
>       withTaskId(task) {
>         blockInfoManager.registerTask(task)
>         assert(blockInfoManager.lockForWriting(blockId).isDefined)
>         val future = Future(blockInfoManager.unlock(blockId, Option(task)))
>         blockInfoManager.releaseAllLocksForTask(task)
>         ThreadUtils.awaitReady(future, 100.millis)
>       }
>     }
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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