[
https://issues.apache.org/jira/browse/ZOOKEEPER-2012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14108040#comment-14108040
]
Raul Gutierrez Segales commented on ZOOKEEPER-2012:
---------------------------------------------------
[~tianq]: why is that what we currently have is not enough to protect the
remove call:
{noformat}
synchronized (pendingQueue) {
if (pendingQueue.size() == 0) {
throw new IOException("Nothing in the queue, but got "
+ replyHdr.getXid());
}
packet = pendingQueue.remove();
}
{noformat}
?
It's already synchronized, it already throws when remove *would* fail. I still
think that part of the patch is a no-op, the rest looks good though.
> 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)