michaeljmarshall commented on a change in pull request #14252:
URL: https://github.com/apache/pulsar/pull/14252#discussion_r815015492



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImpl.java
##########
@@ -231,8 +232,15 @@ private boolean isPhysicalNic(Path path) {
                 Files.readAllBytes(path.resolve("speed"));
                 return true;
             } catch (Exception e) {
-                // wireless nics don't report speed, ignore them.
-                return false;
+                // In some cases, VMs in EC2 won't have the speed reported on 
the NIC and will give a read-error.
+                // Check the type to make sure it's ethernet (type "1")
+                try {
+                    String type = new 
String(Files.readAllBytes(path.resolve("type")), StandardCharsets.UTF_8).trim();
+                    return Integer.parseInt(type) == 1;

Review comment:
       > When that happens, we're ignoring that NIC and it causes that we 
cannot even manually override the NIC capacity in broker.conf
   
   I see now that the point was to make it so it could be overridden.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to