keith-turner commented on code in PR #5303:
URL: https://github.com/apache/accumulo/pull/5303#discussion_r1946796420


##########
core/src/main/java/org/apache/accumulo/core/zookeeper/ZooSession.java:
##########
@@ -348,7 +377,13 @@ public ZooReaderWriter asReaderWriter() {
    * @return connection counter
    */
   public long getConnectionCounter() {

Review Comment:
   This method does not need to be synchronized as it reads the latest from a 
volatile.  Could possibly make it synchronized and further simplify the code, 
but that would require synchronizing a few other methods.  The zookeeper ref 
and zk counter need to be read and written as one. That is done by the way the 
current atomic ref is structured.  It could also be done by having two instance 
variables and always reading/writing either of those variables in a sync block. 
 Since the synchronization would cascade for making two instance variables will 
leave this as-is for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to