Yifan Cai created CASSSIDECAR-368:
-------------------------------------

             Summary: 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
            Reporter: Yifan Cai


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]

Reply via email to