[ 
https://issues.apache.org/jira/browse/RATIS-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18118139#comment-18118139
 ] 

Tsz-wo Sze commented on RATIS-2712:
-----------------------------------

> ... ThreadLocal mechanisms (like in Hadoop RPC) will not work (or requires 
> workaround). 

The Hadoop RPC ThreadLocal should be valid only at the Hadoop RPC layer.  It 
should not force other components supporting it.  For example, Hadoop RPC 
internally use ThreadLocal to store a RemoteUser.  When the thread receives the 
RPC call, it should get the RemoteUser (and clean the ThreadLocal).  Then, pass 
it to another component (say Ratis), which can use any thread model processing 
it.




> Support ThreadLocal propagation for Ratis
> -----------------------------------------
>
>                 Key: RATIS-2712
>                 URL: https://issues.apache.org/jira/browse/RATIS-2712
>             Project: Ratis
>          Issue Type: New Feature
>            Reporter: Ivan Andika
>            Assignee: Ivan Andika
>            Priority: Major
>
> See the issue in https://issues.apache.org/jira/browse/HDDS-16497 .
> Since the StateMachine#applyTransactions and StateMachine#query are executed 
> in another threads, ThreadLocal mechanisms (like in Hadoop RPC) will not work 
> (or requires workaround). 
> We can discuss whether we should support ThreadLocal propagation as a first 
> class feature of Ratis. This can be similar to 
> [https://github.com/alibaba/transmittable-thread-local]
>  



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

Reply via email to