seanyinx commented on a change in pull request #120: SCB-234 fail fast at
SagaStart if all alpha clusters are down
URL:
https://github.com/apache/incubator-servicecomb-saga/pull/120#discussion_r161642097
##########
File path:
omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSender.java
##########
@@ -150,13 +155,15 @@ private MessageSender fastestSender() {
.filter(entry -> entry.getValue() < Long.MAX_VALUE)
.min(Comparator.comparingLong(Entry::getValue))
.map(Entry::getKey)
- .orElse((event -> {
+ .orElse(event -> {
+ clusterStatus.setHealthy(false);
try {
availableMessageSenders.take().send(event);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
- }));
+ clusterStatus.setHealthy(true);
Review comment:
this implement is a bit complex. consider Open Closed principle. how can we
use that with MessageSender?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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