neils-dev opened a new pull request, #4222:
URL: https://github.com/apache/ozone/pull/4222

   ## What changes were proposed in this pull request?
   
   With TRACE enabled, on Recon startup an NPE can occur.  This occurs in 
`ReconServer.start() `when registering with `SCMNodeManager` with a null 
`nodeReport`.  Patch ensures that within the SCMNodeManager.processNodeReport 
the trace causing the NPE is only output if the `nodeReport` is non-null.  
Similar checks are found within the method, however not checked when TRACE is 
enabled.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7854
   
   ## How was this patch tested?
   
   Manually tested with dev cluster in IDE Intellij environment. 
   
   _Without_ patch with log4j trace level enabled:
   ```
   2023-01-30 23:37:54,366 DEBUG node.SCMNodeManager 
(SCMNodeManager.java:processNodeReport(606)) - Processing node report from 
[datanode=localhost]
   2023-01-30 23:37:54,372 ERROR recon.ReconServer (ReconServer.java:call(148)) 
- Error during initializing Recon server.
   com.google.inject.ProvisionException: Unable to provision, see the following 
errors:
   
   1) Error injecting constructor, java.lang.NullPointerException
   
   Recon crashes.
   
   2023-01-30 23:25:47,779 DEBUG node.SCMNodeManager 
(SCMNodeManager.java:processNodeReport(606)) - Processing node report from 
[datanode=localhost]
   ```
   
   With patch with log4j trace level enabled:
   ```
   023-01-30 23:33:48,684 DEBUG node.SCMNodeManager 
(SCMNodeManager.java:processNodeReport(606)) - Processing node report from 
[datanode=localhost]
   2023-01-30 23:33:48,684 INFO  node.SCMNodeManager 
(SCMNodeManager.java:register(397)) - Registered Data node : 
332cd577-4c3c-4a34-9587-3b33b20aa496{ip: 127.0.0.1, host: localhost, ports: 
[REPLICATION=9886, RATIS=9858, RATIS_ADMIN=9857, RATIS_SERVER=9856, 
STANDALONE=9859], networkLocation: /default-rack, certSerialId: null, 
persistedOpState: null, persistedOpStateExpiryEpochSec: 0}
   2023-01-30 23:33:48,686 DEBUG node.SCMNodeManager 
(SCMNodeManager.java:nodeResolve(1266)) - Resolve datanode 127.0.0.1 return 
location /default-rack
   2023-01-30 23:33:48,686 INFO  net.NetworkTopologyImpl 
(NetworkTopologyImpl.java:add(112)) - Added a new node: 
/default-rack/3eae3176-5f0c-4fab-80d3-59c48b9228f0
   2023-01-30 23:33:48,686 DEBUG net.NetworkTopologyImpl 
(NetworkTopologyImpl.java:add(114)) - NetworkTopology became:
   Level: 3
   Number of leaves:2
   /default-rack/332cd577-4c3c-4a34-9587-3b33b20aa496
   ```
   
   Recon comes up without issue.
   


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