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

Tim Onyschak commented on IGNITE-7090:
--------------------------------------

I may be doing something wrong, but when i attempted both solution. Removing 
the closure and manually adjusting the SemaphoreState, neither seemed to work. 
The execution without the closure in same thread seems to hang/deadlock on 
initializeSemaphore() ( specifically cacheView.get(key); )

Then, manually setting SemaphoreState within the 
DataStructuresProcessor#semaphore() witha few iterations of the below code did 
not seem to work as well. I must be missing something within the onNodeRemoved. 
Guessing something around the GridCacheSemaphoreImpl.Sync

 
{code:java}
if(val!=null){    
    GridCacheSemaphoreState semState=(GridCacheSemaphoreState)val;
    boolean updated=false;
    Map<UUID,Integer> waiters = semState.getWaiters();
    for(UUID nodeId:waiters.keySet()){
        ClusterNode node = ctx.cluster().get().node(nodeId);
        if(node==null){
            waiters.remove(nodeId);
            updated=true;
        }
    }
    if(updated) {
        semState.setWaiters(waiters);
        sem0.onUpdate(semState);
        retVal=semState;
    }
 }{code}
 

Any thoughts? 

 

> Semaphore Stuck when no acquirers to assign permit
> --------------------------------------------------
>
>                 Key: IGNITE-7090
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7090
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache, data structures
>    Affects Versions: 2.1, 2.4
>            Reporter: Tim Onyschak
>            Priority: Major
>             Fix For: 2.5
>
>         Attachments: SemaphoreFailoverNoWaitingAcquirerTest.java
>
>
> If no acquirers are available to take permit of semaphore, the permit never 
> gets release and any further acquirerers will wait forever. 
> On node shut down DataStructuresProcessor.dsMap gets cleared out prior to 
> event listener being able to execute onNodeRemoved, hence owner is never 
> cleared out if it was unable to pass to a different acquirer. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to