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

Qiang Tian commented on ZOOKEEPER-2012:
---------------------------------------

Hi [~rgs],
yes, but this scenario is about OOM, if it is thrown just after we remove the 
packet from the queue, we would lose it in cleanup call of upper caller's catch 
block-- the packet is not in both of the 2 queues, so the main thread will hang 
there.


> HBase client hangs after client-side OOM
> ----------------------------------------
>
>                 Key: ZOOKEEPER-2012
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2012
>             Project: ZooKeeper
>          Issue Type: Bug
>            Reporter: Qiang Tian
>            Assignee: Qiang Tian
>            Priority: Minor
>         Attachments: ZOOKEEPER-2012-trunk.patch
>
>
> please see 
> http://apache-hbase.679495.n3.nabble.com/HBase-client-hangs-after-client-side-OOM-td4062675.html.
> it looks the send thread caught the error successfully, as it is finally 
> running fine.. but the cleanup fail to notify the main thread...so I suspect 
> it is a very small timing hole that the packet is not on the 2 queues at the 
> same time..it looks it could happen in the latest code 
> ClientCnxnSocketNIO#doIO as well..
> potential fixes:
> 1)add timeout during wait
> 2)try/catch for the possible timing hole:
> {code}
>                   if (!p.bb.hasRemaining()) {
>                         sentCount++;
>                         outgoingQueue.removeFirstOccurrence(p);
>                         if (p.requestHeader != null
>                                 && p.requestHeader.getType() != OpCode.ping
>                                 && p.requestHeader.getType() != OpCode.auth) {
>                             synchronized (pendingQueue) {
>                                 pendingQueue.add(p);
>                             }
>                         }
>                     }
> {code}
> thoughts?
> thanks.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to