Skip to content

Commit

Permalink
[improve] [broker] Fail fast when it failed to create LoadSheddingStr…
Browse files Browse the repository at this point in the history
…ategy instance (apache#22827)
  • Loading branch information
thetumbled authored Jun 12, 2024
1 parent 266243c commit 1770cbc
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,8 @@ private void handleMetadataSessionEvent(SessionEvent e) {
}

private LoadSheddingStrategy createLoadSheddingStrategy() {
try {
return Reflections.createInstance(conf.getLoadBalancerLoadSheddingStrategy(), LoadSheddingStrategy.class,
Thread.currentThread().getContextClassLoader());
} catch (Exception e) {
log.error("Error when trying to create load shedding strategy: {}",
conf.getLoadBalancerLoadPlacementStrategy(), e);
}
log.error("create load shedding strategy failed. using OverloadShedder instead.");
return new OverloadShedder();
return Reflections.createInstance(conf.getLoadBalancerLoadSheddingStrategy(), LoadSheddingStrategy.class,
Thread.currentThread().getContextClassLoader());
}

/**
Expand Down

0 comments on commit 1770cbc

Please sign in to comment.