ndimiduk commented on a change in pull request #1173: HBASE-23851 Log networks 
and bind addresses when multicast publisher/…
URL: https://github.com/apache/hbase/pull/1173#discussion_r383453022
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/ClusterStatusPublisher.java
 ##########
 @@ -285,27 +295,33 @@ public void connect(Configuration conf) throws 
IOException {
         }
         ni = NetworkInterface.getByInetAddress(localAddress);
       }
-
       Bootstrap b = new Bootstrap();
       b.group(group)
         .channelFactory(new 
HBaseDatagramChannelFactory<Channel>(NioDatagramChannel.class, family))
         .option(ChannelOption.SO_REUSEADDR, true)
         .handler(new ClusterMetricsEncoder(isa));
-
       try {
+        LOG.debug("Channel bindAddress={}, networkInterface={}, INA={}", 
bindAddress, ni, ina);
         channel = (DatagramChannel) b.bind(bindAddress, 0).sync().channel();
         channel.joinGroup(ina, ni, null, channel.newPromise()).sync();
         channel.connect(isa).sync();
+        // Set into configuration in case many networks available. Do this for 
tests so that
+        // server and client use same Interface (presuming share same 
Configuration).
+        // TestAsyncTableRSCrashPublish was failing when connected to VPN 
because extra networks
+        // available with Master binding on one Interface and client on 
another so test failed.
+        if (ni != null) {
+          conf.set(HConstants.STATUS_MULTICAST_NI_NAME, ni.getName());
 
 Review comment:
   What is the expected class/thread that needs this configuration change 
downstream from here? This seems like it introduces a timing race between this 
chore thread and the presumed viewer, which may or may not start after this 
code is hit.
   
   Is there a better approach to take? This strikes me as fishing for 
side-effects with global mutable state.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to