Skip to content

Commit

Permalink
add throw Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
peacewong committed Mar 22, 2024
1 parent 72ac28d commit 4271195
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private Response<ServiceInstance> processInstanceResponse(
: null;

while (null == serviceInstanceResponse
&& StringUtils.isNoneBlank(clientIp)
&& StringUtils.isNotBlank(clientIp)
&& isRPC(linkisLoadBalancerType)
&& System.currentTimeMillis() < endTtime) {
cacheManualRefresher.refresh();
Expand All @@ -120,11 +120,17 @@ && isRPC(linkisLoadBalancerType)
try {
Thread.sleep(5000L);
} catch (InterruptedException e) {
throw new RuntimeException(e);

}
}
}

if (null == serviceInstanceResponse && StringUtils.isNotBlank(clientIp)) {
throw new NoInstanceExistsException(
LinkisRpcErrorCodeSummary.INSTANCE_ERROR.getErrorCode(),
MessageFormat.format(LinkisRpcErrorCodeSummary.INSTANCE_ERROR.getErrorDesc(), clientIp));
}

if (supplier instanceof SelectedInstanceCallback && serviceInstanceResponse.hasServer()) {
((SelectedInstanceCallback) supplier)
.selectedServiceInstance(serviceInstanceResponse.getServer());
Expand Down

0 comments on commit 4271195

Please sign in to comment.