jojochuang commented on code in PR #6467:
URL: https://github.com/apache/ozone/pull/6467#discussion_r1548445400
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java:
##########
@@ -356,6 +359,35 @@ public void testLeaseSoftLimitForHsyncRecoverFile(boolean
force) throws Exceptio
assertNotNull(keyInfo);
}
+ @Test
+ public void testRecoverLeaseWhenOMNotRunning() throws Exception {
+ populateNamespace(true, true, true, true);
+
+ // enable security
+
ozoneManager.getConfiguration().setBoolean(OzoneConfigKeys.OZONE_SECURITY_ENABLED_KEY,
true);
+
+ // set OM as Not Running and enable block token
+ when(ozoneManager.isRunning()).thenReturn(false);
+ when(ozoneManager.isGrpcBlockTokenEnabled()).thenReturn(true);
+
+ GenericTestUtils.LogCapturer logCapturer =
GenericTestUtils.LogCapturer.captureLogs(OMRecoverLeaseRequest.LOG);
+
+ OMClientResponse omClientResponse = validateAndUpdateCache();
+ OMResponse omResponse = omClientResponse.getOMResponse();
+ assertEquals(OzoneManagerProtocolProtos.Status.OK, omResponse.getStatus());
Review Comment:
is it okay to just let it return OK? Or is it better to return an error?
Ideally the client should keep retrying until OM is running.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]