[ 
https://issues.apache.org/jira/browse/YUNIKORN-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301397#comment-17301397
 ] 

Wilfred Spiegelenburg commented on YUNIKORN-572:
------------------------------------------------

This is partially related to YUNIKORN-567.

Investigations for that Jira shows there is slightly more that needs to be done 
but to clear things up: we should not hold the partition write lock while we 
are processing application(s). Read locks are fine as multiple read locks can 
be taken and things progress but scheduling takes a write lock on the 
application and needs a read lock to list the nodes on a partition. So when 
holding a partition write lock any scheduling action on an application could 
cause the simple deadlock:
 * other partition action: partition WRITE -> application READ
 * scheduling action application WRITE -> partition READ

Partition write locks are limited to a subset of actions directly manipulating 
the partition data.

Adding comments to the partition to clarify things.

> terminated app move causes deadlock
> -----------------------------------
>
>                 Key: YUNIKORN-572
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-572
>             Project: Apache YuniKorn
>          Issue Type: Bug
>          Components: core - scheduler
>            Reporter: Wilfred Spiegelenburg
>            Assignee: Wilfred Spiegelenburg
>            Priority: Major
>
> PR #250 for the placeholder cleanup introduced a possible dead lock.
> When moving a terminated app from the queue the queue is unlinked from the 
> app. Before that happens we make sure that the queue tracking is up to date. 
> This requires an application lock.
> The move used to take a lock on the partition and did all its work in one go. 
> With the change to remove the queue from the app we now lock the app inside 
> the partition lock. Since the app is part of the active list until the move 
> is done scheduling might check the app too. This could lead to a dead lock.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to