You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Yifan Cai (Jira)" <ji...@apache.org> on 2024/01/03 17:54:00 UTC

[jira] [Updated] (CASSANDRASC-91) AbstractHandler is handling the request even when it fails to extract params

     [ https://issues.apache.org/jira/browse/CASSANDRASC-91?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yifan Cai updated CASSANDRASC-91:
---------------------------------
     Bug Category: Parent values: Code(13163)Level 1 values: Bug - Unclear Impact(13164)
       Complexity: Low Hanging Fruit
      Component/s: Rest API
    Discovered By: User Report
        Reviewers: Francisco Guerrero, Yifan Cai
         Severity: Low
           Status: Open  (was: Triage Needed)

> AbstractHandler is handling the request even when it fails to extract params
> ----------------------------------------------------------------------------
>
>                 Key: CASSANDRASC-91
>                 URL: https://issues.apache.org/jira/browse/CASSANDRASC-91
>             Project: Sidecar for Apache Cassandra
>          Issue Type: Bug
>          Components: Rest API
>            Reporter: n.v.harikrishna
>            Assignee: n.v.harikrishna
>            Priority: Normal
>              Labels: pull-request-available
>
> AbstractHandler’s handle method is calling extractParamsOrThrow method to parse the request which can fail with HttpException (a runtime exception). When extraction fails, then AbstractHandler is processing the failure using processFailure method and continued to call handleInternal method. Calling handlerInternal even when failed to extract params resulting unwanted results. If the extraction of parameters failes, then AbstractHandler should not call handleInternal.
>  
> Example:
> Passing an invalid character for ring route per keysapce endpoint (handled by RingHandler which is extending AbstractHandler) something like : [localhost1:9043/api/v1/cassandra/ring/keyspaces/keysapce%60] is resulting to _Bad Request_ response, but also resulting NPE from the RingHandler.handleInternal method
>  
> java.lang.NullPointerException: null
>         at org.apache.cassandra.sidecar.routes.RingHandler.lambda$handleInternal$0(RingHandler.java:83)
>         at io.vertx.core.impl.ContextBase.lambda$executeBlocking$1(ContextBase.java:180)
>         at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:277)
>         at io.vertx.core.impl.ContextBase.lambda$internalExecuteBlocking$2(ContextBase.java:199)
>         at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>         at java.lang.Thread.run(Thread.java:748)
>  
> It should terminate processing the request when it could not parse the keyspace.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org