Skip to content

Commit b5f3389

Browse files
committed
HDDS-14212 Fix review comments #1
1 parent f70e2ae commit b5f3389

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public OMResponse submitRequest(OMRequest payload) throws IOException {
200200
}
201201
Exception exp = new Exception(e);
202202
tryOtherHost = shouldRetry(unwrapException(exp),
203-
expectedFailoverCount, requestFailoverCount++);
203+
expectedFailoverCount, ++requestFailoverCount);
204204
if (!tryOtherHost) {
205205
throw new OMException(resultCode);
206206
}

hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/protocolPB/TestS3GrpcOmTransport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ public void testGrpcFailoverProxyExhaustRetry() throws Exception {
222222

223223
@Test
224224
public void testGrpcFailoverProxyCalculatesFailoverCountPerRequest() throws Exception {
225-
final int expectedRequest1FailoverAttemptsCount = 3;
226-
final int expectedRequest2FailoverAttemptsCount = 1;
227225
final int maxFailoverAttempts = 2;
226+
final int expectedRequest2FailoverAttemptsCount = 1;
228227
doFailover = true;
229228
completeFailover = false;
230229
conf.setInt(OzoneConfigKeys.OZONE_CLIENT_FAILOVER_MAX_ATTEMPTS_KEY, maxFailoverAttempts);
@@ -233,10 +232,11 @@ public void testGrpcFailoverProxyCalculatesFailoverCountPerRequest() throws Exce
233232
client.startClient(channel);
234233

235234
assertThrows(Exception.class, () -> client.submitRequest(arbitraryOmRequest()));
236-
assertEquals(expectedRequest1FailoverAttemptsCount, failoverCount);
235+
assertEquals(maxFailoverAttempts, failoverCount);
237236

238237
failoverCount = 0;
239238
completeFailover = true;
239+
//No exception this time
240240
client.submitRequest(arbitraryOmRequest());
241241

242242
assertEquals(expectedRequest2FailoverAttemptsCount, failoverCount);

0 commit comments

Comments
 (0)