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

edcoleman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 279cd598bc61b4796793cc5a44f40f13a9412e24
Merge: 46ed92329c 1584ea83a1
Author: Ed Coleman <edcole...@apache.org>
AuthorDate: Fri May 3 21:44:01 2024 +0000

    Merge remote-tracking branch 'upstream/2.1'
    
    This is basically a no-op imerge for main.  The service lock data
    is written and contains the hostname.  Because of initialization
    order, the port is not included, but it need it can be done with
    a follow-on.

 .../monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --cc server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index 6c07e9bb32,39fe11d91b..10ccf19c6c
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@@ -489,12 -484,16 +489,12 @@@ public class Monitor extends AbstractSe
          log.error("Unable to get hostname", e);
        }
      }
-     log.debug("Using {} to advertise monitor location in ZooKeeper", 
advertiseHost);
+     HostAndPort monitorHostAndPort = HostAndPort.fromParts(advertiseHost, 
livePort);
+     log.debug("Using {} to advertise monitor location in ZooKeeper", 
monitorHostAndPort);
 -    try {
 -      
monitorLock.replaceLockData(monitorHostAndPort.toString().getBytes(UTF_8));
 -    } catch (KeeperException | InterruptedException e) {
 -      throw new IllegalStateException("Exception updating monitor lock with 
host and port", e);
 -    }
  
      MetricsInfo metricsInfo = getContext().getMetricsInfo();
-     metricsInfo.addServiceTags(getApplicationName(),
-         HostAndPort.fromParts(advertiseHost, livePort));
+     metricsInfo.addServiceTags(getApplicationName(), monitorHostAndPort);
 +    metricsInfo.addMetricsProducers(this);
      metricsInfo.init();
  
      try {

Reply via email to