[ https://issues.apache.org/jira/browse/ZOOKEEPER-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611728#action_12611728 ]
Mahadev konar commented on ZOOKEEPER-59: ---------------------------------------- since outstandingrequests does nto control the enable and disable receive then this is just a patch to fix the counters right? This cannot be responsible for connection loss right? also -- just to understand the patch --- it makes three changes --- 1) remove synchronized block around disable recv 2) consistent guard arnd incr/decr outstandingrequests 3) removed synchronization around sk ops in doIO() is that right? > Synchronized block in NIOServerCnxn > ----------------------------------- > > Key: ZOOKEEPER-59 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-59 > Project: Zookeeper > Issue Type: Bug > Components: server > Reporter: Flavio Paiva Junqueira > Assignee: Benjamin Reed > Attachments: ZOOKEEPER-59_1.patch, ZOOKEEPER-59_2.patch > > > There are two synchronized blocks locking on different objects, and to me > they should be guarded by the same object. Here are the parts of the code I'm > talking about: > {noformat} > [EMAIL PROTECTED] > ... > synchronized (this) { > outstandingRequests++; > // check throttling > if (zk.getInProcess() > factory.outstandingLimit) { > disableRecv(); > // following lines should not be needed since we are > already > // reading > // } else { > // enableRecv(); > } > } > {noformat} > {noformat} > [EMAIL PROTECTED] > ... > synchronized (this.factory) { > outstandingRequests--; > // check throttling > if (zk.getInProcess() < factory.outstandingLimit > || outstandingRequests < 1) { > sk.selector().wakeup(); > enableRecv(); > } > } > {noformat} > I think the second one is correct, and the first synchronized block should be > guarded by "this.factory". > This could be related to issue ZOOKEEPER-57, but I have no concrete > indication that this is the case so far. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.