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 2021/11/13 02:51:02 UTC

[GitHub] [helix] xyuanlu opened a new issue #1903: Stoppable API fails to read user input - 500 is returned.

xyuanlu opened a new issue #1903:
URL: https://github.com/apache/helix/issues/1903


   ### Describe the bug
   User will hit a 500 error when passing the following input to stoppable API.
   `instance_name/stoppable -d '{"customized_values": {"keys" : "cc"}}'` or 
   `instance_name/stoppable -d '{}' `
   
   Reason:
   ```
   String customizedInput = null;                 <------------- <1>
   if (node.get(InstancesAccessor.InstancesProperties.customized_values.name()) != null) {
     customizedInput = node.get(InstancesAccessor.InstancesProperties.customized_values.name()).textValue();   <<<----- <2>
   }
   ```
   
   This is shared code that reads user input Json payload. 
   
    
   
   <1> is the cause of this problem. If there is no "customized_values" defined in the payload, "customizedInput" will be null and cause nullptr exception. 
   
   <2> is another problem we have.  JsonNode.textValue() will only convert Textual value this node contains, iff it is a textual JSON node (comes from JSON String value entry). (https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/JsonNode.html#textValue()). 
   
   It will return null is user provide a KV map, witch is a container node instead of a textual node. We should use toString() here.
   
   
   ### To Reproduce
   This issue can be constantly reproducible when passing input mentioned in previous section.  


-- 
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: reviews-unsubscribe@helix.apache.org

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] xyuanlu closed issue #1903: Stoppable API fails to read user input - 500 is returned.

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


   


-- 
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: reviews-unsubscribe@helix.apache.org

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