[ https://issues.apache.org/jira/browse/CASSANDRASC-91?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800915#comment-17800915 ]
n.v.harikrishna commented on CASSANDRASC-91: -------------------------------------------- Raised pr: [CASSANDRASC-91 Returning when AbstractHandler encounters exception while extracting params from the request. by nvharikrishna · Pull Request #88 · apache/cassandra-sidecar (github.com)|https://github.com/apache/cassandra-sidecar/pull/88] > 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 > 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-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org