This is an automated email from the ASF dual-hosted git repository.

mmarshall pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new 0d69ead439f [fix][broker] Make ServerCnx#originalAuthData volatile 
(#19507)
0d69ead439f is described below

commit 0d69ead439f98b92bca6df2f7493d42b2543952c
Author: Michael Marshall <[email protected]>
AuthorDate: Mon Feb 13 23:37:07 2023 -0600

    [fix][broker] Make ServerCnx#originalAuthData volatile (#19507)
    
    Fixes #19431
    
    `authenticationData` is already `volatile`. We use `originalAuthData` when 
set, so we should match the style. In #19431, I proposed that we find a way to 
not use `volatile`. I still think this might be a "better" approach, but it 
will be a larger change, and since we already use `volatile` for 
`authenticationData`, I think this is the right change for now.
    
    It's possible that this is not a bug, given that the `originalAuthData` 
does not change frequently. However, we always want to use up to date values 
for authorization.
    
    * Add `volatile` keyword to `ServerCnx#originalAuthData`.
    
    This change is a trivial rework / code cleanup without any test coverage.
    
    - [x] `doc-not-needed`
    
    PR in forked repository: skipping test in fork.
    
    (cherry picked from commit c4c174424192202bc0aec9414a1fec0334600fca)
    (cherry picked from commit e1d9941656eb0f67c9557b3ae9c1297fbcee7b2d)
---
 .../src/main/java/org/apache/pulsar/broker/service/ServerCnx.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
index 1d80c02f356..fd73156ae2d 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
@@ -175,7 +175,7 @@ public class ServerCnx extends PulsarHandler implements 
TransportCnx {
     // In case of proxy, if the authentication credentials are forwardable,
     // it will hold the credentials of the original client
     private AuthenticationState originalAuthState;
-    private AuthenticationDataSource originalAuthData;
+    private volatile AuthenticationDataSource originalAuthData;
     private boolean pendingAuthChallengeResponse = false;
 
     // Max number of pending requests per connections. If multiple producers 
are sharing the same connection the flow

Reply via email to