Skip to content

Commit

Permalink
Fix NPE bug when creating connection group in ConnectionManager
Browse files Browse the repository at this point in the history
- The NPE will occur when multiple threads are trying to create the connection group for the same namespace

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
  • Loading branch information
sczyh30 committed Jan 31, 2019
1 parent 412e1ec commit cd02fad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static ConnectionGroup getOrCreateGroup(String namespace) {
ConnectionGroup group = CONN_MAP.get(namespace);
if (group == null) {
synchronized (CREATE_LOCK) {
if (CONN_MAP.get(namespace) == null) {
if ((group = CONN_MAP.get(namespace)) == null) {
group = new ConnectionGroup(namespace);
CONN_MAP.put(namespace, group);
}
Expand Down

0 comments on commit cd02fad

Please sign in to comment.