neils-dev commented on a change in pull request #2901:
URL: https://github.com/apache/ozone/pull/2901#discussion_r789289981
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerServiceGrpc.java
##########
@@ -126,23 +127,15 @@ public void submitRequest(OMRequest request,
omResponse =
UserGroupInformation.getCurrentUser().doAs(
(PrivilegedExceptionAction<OMResponse>) () -> {
- try {
return this.omTranslator.
submitRequest(NULL_RPC_CONTROLLER, request);
- } catch (Throwable se) {
- Throwable e = se.getCause();
- if (e == null) {
- throw new IOException(se);
- } else {
- throw e instanceof IOException ?
- (IOException) e : new IOException(se);
- }
- }
});
} catch (Throwable e) {
- omResponse = createErrorResponse(
- request,
- new IOException(e));
+ IOException ex = new IOException(e.getCause());
+ responseObserver.onError(Status
+ .INTERNAL
+ .withDescription(ex.getMessage())
+ .asRuntimeException());
}
responseObserver.onNext(omResponse);
Review comment:
Right, `onNext` does not need to be outside of the try...catch block.
Clean up with onNext within try block, removing the need to initialize
`OmResponse` outside of the block as in the next comment.
--
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]