Skip to content

Commit 4402a90

Browse files
authored
don't ask for cached cluster state in health check case (#95)
* dont ask for cached cluster state in health check case
1 parent 95e206c commit 4402a90

File tree

1 file changed

+3
-14
lines changed
  • src/main/java/com/arpnetworking/clusteraggregator

1 file changed

+3
-14
lines changed

src/main/java/com/arpnetworking/clusteraggregator/Status.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@
3232
import java.time.Duration;
3333
import java.util.Map;
3434
import java.util.concurrent.CompletableFuture;
35-
import java.util.concurrent.CompletionStage;
3635
import java.util.function.Function;
3736

3837
/**
3938
* Periodically polls the cluster status and caches the result.
4039
*
4140
* Accepts the following messages:
42-
* STATUS: Replies with a StatusResponse message containing the service status data
43-
* HEALTH: Replies with a boolean value
44-
* ClusterEvent.CurrentClusterState: Updates the cached state of the cluster
41+
* {@link StatusRequest}: Replies with a StatusResponse message containing the service status data
42+
* {@link HealthRequest}: Replies with a boolean value, true indicating healthy, false indicating unhealthy
4543
*
4644
* Internal-only messages:
47-
* POLL: Triggers an update of the cluster data.
45+
* {@link AssociationErrorEvent}: Evaluates the possibility of the node being quarantined
4846
*
4947
* @author Brandon Arp (brandon dot arp at inscopemetrics dot com)
5048
*/
@@ -93,15 +91,6 @@ public Receive createReceive() {
9391
}
9492
})
9593
.match(HealthRequest.class, message -> {
96-
final CompletionStage<ClusterStatusCache.StatusResponse> stateFuture = PatternsCS
97-
.ask(
98-
_clusterStatusCache,
99-
new ClusterStatusCache.GetRequest(),
100-
Duration.ofSeconds(3))
101-
.thenApply(CAST_MAPPER);
102-
PatternsCS.pipe(stateFuture, context().dispatcher()).to(self(), sender());
103-
})
104-
.match(ClusterStatusCache.StatusResponse.class, response -> {
10594
final boolean healthy = _cluster.readView().self().status() == MemberStatus.up() && !_quarantined;
10695
sender().tell(healthy, getSelf());
10796
})

0 commit comments

Comments
 (0)