You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/08/25 19:30:52 UTC

[GitHub] [helix] mgao0 opened a new issue #1313: Potential NPE in customized view aggregation latency metric calculation

mgao0 opened a new issue #1313:
URL: https://github.com/apache/helix/issues/1313


   ### Describe the bug
   The customized view latency metric calculation code needs two improvements:
   1. Better handling to avoid NPE: 
   partitionStartTimeMap is of type Map<String, Long>. 
   `long timestamp = partitionStartTimeMap.get(instanceName);`
   The implicit conversion from Long to long could throw null pointer exception if the get() returns null.
   2. Reduce noise in the log
   `   if (!stateMapEntry.getValue().equals(oldStateMap.get(instanceName))) { `
   `              long timestamp = partitionStartTimeMap.get(instanceName);`
   `              if (timestamp > 0) {`
   `                customizedViewMonitor.recordUpdateToAggregationLatency(curTime - timestamp);`
    `             } else {`
    `              LOG.warn(`
   `                    "Failed to find customized state update time stamp for resource {} partition {}, instance {}, on cluster {} the` `number should be positive.",`
   `                    resourceName, partitionName, instanceName, clusterName);`
   `              }`
   `            }`
   In current code, if the customized state is deleted, it still enters this if condition, and will eventual log a warning message in the logs. It creates too much noise. We want to: 1. if it's a deletion we don't enter this condition 2. Reduce the log level to info because it's not a critical failure
   
   ### To Reproduce
   N/A
   
   ### Expected behavior
   Prevent the NPE.
   Not log for deletion of customized state.
   
   ### Additional context
   Add any other context about the problem here.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] pkuwm closed issue #1313: Issues in customized view aggregation latency metric calculation

Posted by GitBox <gi...@apache.org>.
pkuwm closed issue #1313:
URL: https://github.com/apache/helix/issues/1313


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org