diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java index a934e1f4acbc..0df3b772fbbb 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java @@ -63,6 +63,8 @@ * @see Connection * @since 1.0.0 */ +@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IS2_INCONSISTENT_SYNC", + justification="writeBufferPeriodicFlushTimer needs to be synchronized only when not null, and in mutual exclusion with close() and flush(true). However to needs to synchronize with flush(false) coming from mutate") @InterfaceAudience.Private @InterfaceStability.Evolving public class BufferedMutatorImpl implements BufferedMutator { @@ -304,7 +306,7 @@ public void flush() throws InterruptedIOException, RetriesExhaustedWithDetailsEx boolean haveLocked = false; if (writeBufferPeriodicFlushTimer != null) { lock.lock(); - haveLocked = false; // make sure to unlock even if writeBufferPeriodicFlushTimer is set to null before the end + haveLocked = true; // make sure to unlock even if writeBufferPeriodicFlushTimer is set to null before the end } try { checkClose();