You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/02/19 13:17:43 UTC

[GitHub] [skywalking] hanahmily opened a new pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap

hanahmily opened a new pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap
URL: https://github.com/apache/skywalking/pull/4385
 
 
   Please answer these questions before submitting pull request
   
   - Why submit this pull request?
   - [x] Bug fix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   
   ___
   ### Bug fix
   - Bug description.
   
   If IntKeyLongValuesHashMap#toStorageDate generate an empty string,
   that usually because there's no any traffic in one minute. When syncing
   it to cache, IntKeyLongValuesHashMap#toObject will raise a NPE.
   
   - How to fix?
   if an empty string pass into toObject, just return
   

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


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap
URL: https://github.com/apache/skywalking/pull/4385#discussion_r381332910
 
 

 ##########
 File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/IntKeyLongValueHashMap.java
 ##########
 @@ -57,6 +58,9 @@ public String toStorageData() {
 
     @Override
     public void toObject(String data) {
+        if (Strings.isNullOrEmpty(data)) {
 
 Review comment:
   Personally, I want to say, this is harmful change. This `data` should not generate if there is no value of this column. `Calculate` func should make sure the `value` column is generated rather than using this `null` check. Such as `PercentileMetrics#calculate`, it guarantees the 5 values generated permanently. If there is no value, put the default value based on this metrics func, otherwise, which value should be shown up in the final query?

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


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap
URL: https://github.com/apache/skywalking/pull/4385#discussion_r382338581
 
 

 ##########
 File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/IntKeyLongValueHashMap.java
 ##########
 @@ -57,6 +58,9 @@ public String toStorageData() {
 
     @Override
     public void toObject(String data) {
+        if (Strings.isNullOrEmpty(data)) {
 
 Review comment:
   @hanahmily Any feedback?

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


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng closed pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap

Posted by GitBox <gi...@apache.org>.
wu-sheng closed pull request #4385: Fix NPE of decoding IntKeyLongValuesHashMap
URL: https://github.com/apache/skywalking/pull/4385
 
 
   

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


With regards,
Apache Git Services