You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/09/09 16:48:30 UTC

[brooklyn-server] branch master updated: tidy of log messages and toString

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

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 66cd0c2  tidy of log messages and toString
66cd0c2 is described below

commit 66cd0c204454f284c692943406a504c841db3374
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Thu Sep 9 17:48:09 2021 +0100

    tidy of log messages and toString
    
    fix lookups which might not be available
---
 .../apache/brooklyn/core/mgmt/ha/HighAvailabilityManagerImpl.java   | 6 +++---
 .../java/org/apache/brooklyn/location/ssh/SshMachineLocation.java   | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/HighAvailabilityManagerImpl.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/HighAvailabilityManagerImpl.java
index cc44874..2779f4f 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/HighAvailabilityManagerImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/HighAvailabilityManagerImpl.java
@@ -837,10 +837,10 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager {
                 });
         }
         String message = "Management node "+ownNodeId+" detected ";
-        String currMasterSummary = currMasterNodeId + "(" + (currMasterNodeRecord==null ? "<none>" : timestampString(currMasterNodeRecord.getRemoteTimestamp())) + ")";
+        String currMasterSummary = currMasterNodeId + " (" + (currMasterNodeRecord==null ? "<none>" : timestampString(currMasterNodeRecord.getRemoteTimestamp())) + ")";
         if (weAreNewMaster && (ownNodeRecord.getStatus() == ManagementNodeState.MASTER)) {
-            LOG.warn(message + "we must reassert master status, as was stolen and then failed at "+
-                (currMasterNodeRecord==null ? "a node which has gone away" : currMasterSummary));
+            LOG.warn(message + "we must reassert master status, as we believe we should be master and other master "+
+                (currMasterNodeRecord==null ? "(a node which has gone away)" : currMasterSummary)+" has failed");
             publishPromotionToMaster();
             publishHealth();
             return;
diff --git a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
index 577e1d9..9acee3d 100644
--- a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
+++ b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
@@ -904,7 +904,8 @@ public class SshMachineLocation extends AbstractMachineLocation implements Machi
 
     @Override
     public String toString() {
-        return "SshMachineLocation["+getDisplayName()+":"+user+"@"+address+":"+getPort()+"(id="+getId()+")]";
+        // previously we did getPort but that might not work eg if pointing at entity which is not managed
+        return "SshMachineLocation["+getDisplayName()+":"+user+"@"+address+"(id="+getId()+")]";
     }
 
     @Override