michaeljmarshall commented on a change in pull request #9393:
URL: https://github.com/apache/pulsar/pull/9393#discussion_r572630364
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImpl.java
##########
@@ -75,18 +75,17 @@ public LinuxBrokerHostUsageImpl(int
hostUsageCheckIntervalMin,
this.lastCollection = 0L;
this.usage = new SystemResourceUsage();
this.overrideBrokerNicSpeedGbps = overrideBrokerNicSpeedGbps;
- executorService.scheduleAtFixedRate(this::calculateBrokerHostUsage, 0,
- hostUsageCheckIntervalMin, TimeUnit.MINUTES);
boolean isCGroupsEnabled = false;
try {
isCGroupsEnabled =
Files.exists(Paths.get(CGROUPS_CPU_USAGE_PATH));
} catch (Exception e) {
log.warn("Failed to check cgroup CPU usage file: {}",
e.getMessage());
}
-
this.isCGroupsEnabled = isCGroupsEnabled;
- calculateBrokerHostUsage();
+
+ executorService.scheduleAtFixedRate(this::calculateBrokerHostUsage, 0,
Review comment:
Also note that any bad state, like an infinite cpu usage, would be
stored for a minute until the cpu usage is recalculated. Considering that this
test runs quickly, that would definitely be a culprit for our flaky test.
----------------------------------------------------------------
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]