eolivelli commented on a change in pull request #742: ZOOKEEPER-3223: Configure
Spotbugs
URL: https://github.com/apache/zookeeper/pull/742#discussion_r244996468
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/FileTxnLog.java
##########
@@ -180,7 +180,7 @@ public static void setPreallocSize(long size) {
* @param serverStats used to update fsyncThresholdExceedCount
*/
@Override
- public void setServerStats(ServerStats serverStats) {
+ public synchronized void setServerStats(ServerStats serverStats) {
Review comment:
This is spotbugs error:
`[ERROR] Inconsistent synchronization of
org.apache.zookeeper.server.persistence.FileTxnLog.serverStats; locked 66% of
time [org.apache.zookeeper.server.persistence.FileTxnLog,
org.apache.zookeeper.server.persistence.FileTxnLog,
org.apache.zookeeper.server.persistence.FileTxnLog] Unsynchronized access at
FileTxnLog.java:[line 184]Synchronized access at FileTxnLog.java:[line
381]Synchronized access at FileTxnLog.java:[line 382] IS2_INCONSISTENT_SYNC
`
I think this change is safe
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services