sumitagrawl commented on code in PR #8059:
URL: https://github.com/apache/ozone/pull/8059#discussion_r1996849801


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java:
##########
@@ -173,43 +171,13 @@ private OMResponse internalProcessRequest(OMRequest 
request) throws ServiceExcep
         return cached;
       }
 
-      // process new request
-      OMClientRequest omClientRequest = null;
-      final OMRequest requestToSubmit;
-      try {
-        omClientRequest = createClientRequest(request, ozoneManager);
-        // TODO: Note: Due to HDDS-6055, createClientRequest() could now
-        //  return null, which triggered the findbugs warning.
-        //  Added the assertion.
-        assert (omClientRequest != null);
-        OMClientRequest finalOmClientRequest = omClientRequest;
-
-        requestToSubmit = preExecute(finalOmClientRequest);
-        this.lastRequestToSubmit = requestToSubmit;
-      } catch (IOException ex) {
-        if (omClientRequest != null) {
-          OMAuditLogger.log(omClientRequest.getAuditBuilder());
-          omClientRequest.handleRequestFailure(ozoneManager);
-        }
-        return createErrorResponse(request, ex);
-      }
-
-      final OMResponse response = omRatisServer.submitRequest(requestToSubmit);
-      if (!response.getSuccess()) {
-        omClientRequest.handleRequestFailure(ozoneManager);
-      }
-      return response;
+      this.lastRequestToSubmit = request;
+      return ozoneManager.getOmGateway().submit(request);

Review Comment:
   It just validate last request submitted command type. This has no impact 
over test code as pre-execute do not change command type, only check for 
submitted command-type. I think this kind of injection is not correct which can 
be handled with Mock.spy() or other mechanism.
   
   Order change: Existing:
   ```
   1. requestToSubmit = preExecute()
   2. this.lastRequestToSubmit = requestToSubmit
   ```
   Change:
   ```
   1. this.lastRequestToSubmit = requestToSubmit
   2. As part of OMGateway, preexecute() is performed
   ```



-- 
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]

Reply via email to