|
4 | 4 | import java.net.URISyntaxException;
|
5 | 5 | import java.time.Duration;
|
6 | 6 | import java.time.Instant;
|
7 |
| -import java.util.Arrays; |
8 | 7 | import java.util.Collections;
|
9 | 8 | import java.util.List;
|
10 | 9 | import java.util.concurrent.CompletableFuture;
|
@@ -54,7 +53,8 @@ public YdbTransportImpl(GrpcTransportBuilder builder) {
|
54 | 53 |
|
55 | 54 | this.channelFactory = builder.getManagedChannelFactory();
|
56 | 55 | this.scheduler = builder.getSchedulerFactory().get();
|
57 |
| - this.callOptions = new AuthCallOptions(scheduler, Arrays.asList(discoveryEndpoint), channelFactory, builder); |
| 56 | + this.callOptions = new AuthCallOptions(scheduler, Collections.singletonList(discoveryEndpoint), |
| 57 | + channelFactory, builder); |
58 | 58 | this.channelPool = new GrpcChannelPool(channelFactory, scheduler);
|
59 | 59 | this.endpointPool = new EndpointPool(balancingSettings);
|
60 | 60 | this.discovery = new YdbDiscovery(new DiscoveryHandler(), scheduler, database, discoveryTimeout);
|
@@ -171,7 +171,10 @@ protected GrpcChannel getChannel(GrpcRequestSettings settings) {
|
171 | 171 | @Override
|
172 | 172 | protected void updateChannelStatus(GrpcChannel channel, io.grpc.Status status) {
|
173 | 173 | // Usally CANCELLED is received when ClientCall is canceled on client side
|
174 |
| - if (!status.isOk() && status.getCode() != io.grpc.Status.Code.CANCELLED) { |
| 174 | + if (!status.isOk() && status.getCode() != io.grpc.Status.Code.CANCELLED && |
| 175 | + status.getCode() != io.grpc.Status.Code.DEADLINE_EXCEEDED && |
| 176 | + status.getCode() != io.grpc.Status.Code.RESOURCE_EXHAUSTED |
| 177 | + ) { |
175 | 178 | endpointPool.pessimizeEndpoint(channel.getEndpoint());
|
176 | 179 | }
|
177 | 180 | }
|
|
0 commit comments