Skip to content

Commit

Permalink
Update getState
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed Jan 17, 2025
1 parent 548bd94 commit cc6b2b6
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ public String getLabel(String key) {

@Override
public EndpointState getState() {
return EndpointState.HEALTHY;
switch (getConnectivityState()) {
case READY:
return EndpointState.HEALTHY;
case IDLE:
case CONNECTING:
case TRANSIENT_FAILURE:
return EndpointState.DISABLE;
case SHUTDOWN:
default:
return EndpointState.CLOSING;
}
}

public Subchannel getSubchannel() {
Expand Down

0 comments on commit cc6b2b6

Please sign in to comment.