[
https://issues.apache.org/jira/browse/CASSSIDECAR-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yifan Cai updated CASSSIDECAR-368:
----------------------------------
Authors: Yifan Cai
Test and Documentation Plan: ci; unit
Status: Patch Available (was: Open)
PR: https://github.com/apache/cassandra-sidecar/pull/298
CI:
https://app.circleci.com/pipelines/github/yifan-c/cassandra-sidecar?branch=CASSSIDECAR-368%2Ffix-request-continuation-in-wrong-thread
> CachedAuthorizationHandler could continue the execution on the wrong thread
> ---------------------------------------------------------------------------
>
> Key: CASSSIDECAR-368
> URL: https://issues.apache.org/jira/browse/CASSSIDECAR-368
> Project: Sidecar for Apache Cassandra
> Issue Type: Bug
> Components: Rest API, Security
> Reporter: Yifan Cai
> Assignee: Yifan Cai
> Priority: Major
> Fix For: 0.3
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> CachedAuthorizationHandler leverages Caffeine AsyncCache to perform the authZ
> operations in async. When the operations completes, the continuation runs in
> the AsyncCache thread. It is problematic, as it violates Vertx's threading
> model, leading to the subsequent handling running in a different thread,
> causing race conditions. Vertx expects all handlers running in the same
> context/event-loop thread.
> The proposed fix is to ensure the continuation is scheduled back to the
> original context. (Note: not the RoutingContext, but Context).
> In addition, we could move away from using AsyncCache and use Cache with
> Future being cached. It would simplifies the code and thread pool management
> a bit.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]