Skip to content

Commit 5a59fc3

Browse files
committed
Revert lost PR
1 parent 693d13d commit 5a59fc3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/src/main/java/tech/ydb/core/impl/BaseGrpcTransport.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ private class ChannelStatusHandler implements GrpcStatusHandler {
243243
@Override
244244
public void accept(io.grpc.Status status, Metadata trailers) {
245245
// Usually CANCELLED is received when ClientCall is canceled on client side
246-
if (!status.isOk() && status.getCode() != io.grpc.Status.Code.CANCELLED) {
246+
if (!status.isOk() && status.getCode() != io.grpc.Status.Code.CANCELLED
247+
&& status.getCode() != io.grpc.Status.Code.DEADLINE_EXCEEDED
248+
&& status.getCode() != io.grpc.Status.Code.RESOURCE_EXHAUSTED) {
247249
pessimizeEndpoint(channel.getEndpoint(), "by grpc code " + status.getCode());
248250
}
249251

core/src/test/java/tech/ydb/core/impl/pool/EndpointPoolTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public class EndpointPoolTest {
3939

4040
@Before
4141
public void setUp() throws IOException {
42-
Mockito.when(socketFactory.createSocket()).thenReturn(socket);
43-
Mockito.doNothing().when(socket).connect(Mockito.any(SocketAddress.class));
4442
mocks = MockitoAnnotations.openMocks(this);
4543
threadLocalStaticMock.when(ThreadLocalRandom::current).thenReturn(random);
4644
socketFactoryStaticMock.when(SocketFactory::getDefault).thenReturn(socketFactory);
45+
Mockito.when(socketFactory.createSocket()).thenReturn(socket);
46+
Mockito.doNothing().when(socket).connect(Mockito.any(SocketAddress.class));
4747
}
4848

4949
@After

0 commit comments

Comments
 (0)