From 47491f9a119faf75abaa56f676ae93460583bd3f Mon Sep 17 00:00:00 2001 From: cnauroth Date: Sat, 20 Sep 2014 20:53:09 -0700 Subject: [PATCH] HDFS-7107. Avoid Findbugs warning for synchronization on AbstractNNFailoverProxyProvider#fallbackToSimpleAuth. Contributed by Chris Nauroth. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../server/namenode/ha/AbstractNNFailoverProxyProvider.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 9fa06d4966..dfdc21fcdb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -905,6 +905,9 @@ Release 2.6.0 - UNRELEASED HDFS-7105. Allow falling back to a non-SASL connection on DataTransferProtocol in several edge cases. (cnauroth) + HDFS-7107. Avoid Findbugs warning for synchronization on + AbstractNNFailoverProxyProvider#fallbackToSimpleAuth. (cnauroth) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/AbstractNNFailoverProxyProvider.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/AbstractNNFailoverProxyProvider.java index 08e82be59d..a0aa10bf68 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/AbstractNNFailoverProxyProvider.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/AbstractNNFailoverProxyProvider.java @@ -38,12 +38,14 @@ public abstract class AbstractNNFailoverProxyProvider implements public abstract boolean useLogicalURI(); /** - * Set for tracking if a secure client falls back to simple auth. + * Set for tracking if a secure client falls back to simple auth. This method + * is synchronized only to stifle a Findbugs warning. * * @param fallbackToSimpleAuth - set to true or false during this method to * indicate if a secure client falls back to simple auth */ - public void setFallbackToSimpleAuth(AtomicBoolean fallbackToSimpleAuth) { + public synchronized void setFallbackToSimpleAuth( + AtomicBoolean fallbackToSimpleAuth) { this.fallbackToSimpleAuth = fallbackToSimpleAuth; } }