adoroszlai commented on PR #7914:
URL: https://github.com/apache/ozone/pull/7914#issuecomment-2669472095

   Thanks @nandakumar131 for updating the patch.  Looks like `TestSCMCertStore` 
unit test does not use Ratis server and is failing with:
   
   ```
   NullPointerException: Cannot invoke 
"org.apache.hadoop.hdds.scm.ha.SCMRatisServer.getProxyHandler(org.apache.hadoop.hdds.protocol.proto.SCMRatisProtocol$RequestType,
 java.lang.Class, Object)" because "this.scmRatisServer" is null
        at 
org.apache.hadoop.hdds.scm.server.SCMCertStore$Builder.build(SCMCertStore.java:229)
        at 
org.apache.hadoop.hdds.scm.server.TestSCMCertStore.setUp(TestSCMCertStore.java:72)
   ```
   
   Should we handle this case in the builder, or make the constructor visible 
for the test?
   
   ```diff
   diff --git 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
   index e721cec41f..63b17eeea3 100644
   --- 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
   +++ 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
   @@ -29,7 +29,7 @@
    import java.util.concurrent.locks.Lock;
    import java.util.concurrent.locks.ReentrantLock;
    import org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeType;
   -import org.apache.hadoop.hdds.protocol.proto.SCMRatisProtocol;
   +import org.apache.hadoop.hdds.protocol.proto.SCMRatisProtocol.RequestType;
    import org.apache.hadoop.hdds.scm.ha.SCMRatisServer;
    import org.apache.hadoop.hdds.scm.metadata.SCMMetadataStore;
    import org.apache.hadoop.hdds.security.exception.SCMSecurityException;
   @@ -224,8 +224,9 @@ public Builder setRatisServer(final SCMRatisServer 
ratisServer) {
    
        public CertificateStore build() {
          final SCMCertStore scmCertStore = new SCMCertStore(metadataStore);
   -      return 
scmRatisServer.getProxyHandler(SCMRatisProtocol.RequestType.CERT_STORE,
   -         CertificateStore.class, scmCertStore);
   +      return scmRatisServer != null
   +          ? scmRatisServer.getProxyHandler(RequestType.CERT_STORE, 
CertificateStore.class, scmCertStore)
   +          : scmCertStore;
        }
      }
    }
   ```


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