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

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 375f383  NO-JIRA Avoid NPE during backup shutdown
     new 8b3eeaf  This closes #2596
375f383 is described below

commit 375f383e90306f768350003be6c83796b54a8cf0
Author: Howard Gao <howard....@gmail.com>
AuthorDate: Fri Mar 29 16:02:53 2019 +0800

    NO-JIRA Avoid NPE during backup shutdown
    
    When a backup starts without a live, it's nodeID is null.
    Added a null check in ClusterConnection's stop() to avoid
    NPE if it's shut down.
---
 .../artemis/core/server/cluster/impl/ClusterConnectionImpl.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
index aa68b81..1950418 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -439,7 +439,9 @@ public final class ClusterConnectionImpl implements 
ClusterConnection, AfterConn
       if (managementService != null) {
          TypedProperties props = new TypedProperties();
          props.putSimpleStringProperty(new SimpleString("name"), name);
-         Notification notification = new 
Notification(nodeManager.getNodeId().toString(), 
CoreNotificationType.CLUSTER_CONNECTION_STOPPED, props);
+         //nodeID can be null if there's only a backup
+         SimpleString nodeId = nodeManager.getNodeId();
+         Notification notification = new Notification(nodeId == null ? null : 
nodeId.toString(), CoreNotificationType.CLUSTER_CONNECTION_STOPPED, props);
          managementService.sendNotification(notification);
       }
       executor.execute(new Runnable() {

Reply via email to