This is an automated email from the ASF dual-hosted git repository.
mmarshall pushed a commit to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.11 by this push:
new e1d9941656e [fix][broker] Make ServerCnx#originalAuthData volatile
(#19507)
e1d9941656e is described below
commit e1d9941656eb0f67c9557b3ae9c1297fbcee7b2d
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)
---
.../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 9a62a7a562b..30d054f891a 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
@@ -183,7 +183,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