Patrick Hunt commented on ZOOKEEPER-140:

Flavio, could you update the server java code with a summary of this JIRA as a 
comment? Perhaps as part of a class javadoc so that it will show up in the 
generated javadoc html.

> Deadlock in QuorumCnxManager
> ----------------------------
>                 Key: ZOOKEEPER-140
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-140
>             Project: Zookeeper
>          Issue Type: Bug
>            Reporter: Flavio Paiva Junqueira
> Frequently the servers deadlock in QuorumCnxManager:initiateConnection on
> s.read(msgBuffer) when reading the challenge from the peer.
> Calls to initiateConnection and receiveConnection are synchronized, so only 
> one or the other can be executing at a time. This prevents two connections 
> from opening between the same pair of servers.
> However, it seems that this leads to deadlock, as in this scenario:
> {noformat}
> A (initiate --> B)
> B (initiate --> C)
> C (initiate --> A)
> {noformat}
> initiateConnection can only complete when receiveConnection runs on the 
> remote peer and answers the challenge. If all servers are blocked in 
> initiateConnection, receiveConnection never runs and leader election halts.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to