Ethanlm commented on a change in pull request #3108: [STORM-3492] Add config to
prevent good supervisor with bad workers f…
URL: https://github.com/apache/storm/pull/3108#discussion_r315871430
##########
File path:
storm-server/src/main/java/org/apache/storm/scheduler/blacklist/BlacklistScheduler.java
##########
@@ -132,20 +134,20 @@ private void badSupervisors(Map<String,
SupervisorDetails> supervisors) {
for (String key : badSupervisorKeys) {
badSupervisors.put(key, cachedSupervisors.get(key));
}
-
- for (Map.Entry<String, SupervisorDetails> entry :
supervisors.entrySet()) {
- String key = entry.getKey();
- SupervisorDetails supervisorDetails = entry.getValue();
- if (cachedSupervisors.containsKey(key)) {
- Set<Integer> badSlots = badSlots(supervisorDetails, key);
- if (badSlots.size() > 0) { //supervisor contains bad slots
- badSupervisors.put(key, badSlots);
+ if (blacklistOnBadSlots) {
+ for (Map.Entry<String, SupervisorDetails> entry :
supervisors.entrySet()) {
+ String key = entry.getKey();
+ SupervisorDetails supervisorDetails = entry.getValue();
+ if (cachedSupervisors.containsKey(key)) {
+ Set<Integer> badSlots = badSlots(supervisorDetails, key);
+ if (badSlots.size() > 0) { //supervisor contains bad slots
+ badSupervisors.put(key, badSlots);
+ }
+ } else {
+ cachedSupervisors.put(key,
supervisorDetails.getAllPorts()); //new supervisor to cache
Review comment:
I think this line should execute anyway no matter if `blacklistOnBadSlots`
is true or false
----------------------------------------------------------------
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