You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by iv...@apache.org on 2018/01/26 17:16:41 UTC

[bookkeeper] branch master updated: [MERGE YAHOO REPO] Fixed NPE when accessing readonly bookie list

This is an automated email from the ASF dual-hosted git repository.

ivank pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 0143075  [MERGE YAHOO REPO] Fixed NPE when accessing readonly bookie list
0143075 is described below

commit 01430750ce5a2f7c46cce942a7aa6116e41b9508
Author: Matteo Merli <mm...@yahoo-inc.com>
AuthorDate: Fri Jan 26 18:16:35 2018 +0100

    [MERGE YAHOO REPO] Fixed NPE when accessing readonly bookie list
    
    Descriptions of the changes in this PR:
    This is cherry-pick from yahoo repo of branch yahoo-4.3.
    
    original commit is:
    https://github.com/yahoo/bookkeeper/commit/270b69e4
    Fixed NPE when accessing readonly bookie list
    
    Author: Matteo Merli <mm...@yahoo-inc.com>
    
    Reviewers: Ivan Kelly <iv...@apache.org>, Sijie Guo <si...@apache.org>
    
    This closes #1058 from jiazhai/cherry_picks/i_165
---
 .../apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
index 24460d5..7dcd728 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
@@ -192,7 +192,8 @@ class RackawareEnsemblePlacementPolicyImpl extends TopologyAwareEnsemblePlacemen
     protected Cache<BookieSocketAddress, Long> slowBookies;
     protected BookieNode localNode;
     protected final ReentrantReadWriteLock rwLock;
-    protected ImmutableSet<BookieSocketAddress> readOnlyBookies = null;
+    // Initialize to empty set
+    protected ImmutableSet<BookieSocketAddress> readOnlyBookies = ImmutableSet.of();
     protected boolean reorderReadsRandom = false;
     protected boolean enforceDurability = false;
     protected int stabilizePeriodSeconds = 0;

-- 
To stop receiving notification emails like this one, please contact
ivank@apache.org.