Github user nkalmar commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/501#discussion_r184676493 --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java --- @@ -311,6 +325,9 @@ public synchronized void commit() throws IOException { syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { + if(serverStats != null) { + serverStats.incrementFsyncThresholdExceedCount(); + } --- End diff -- We could, sure. This nullcheck is just an extra fail safe measurement. It should be never null actually, so if it is, that's definitely some error. (If it would be possible, serverStats would come from constructor actually).
---