This is an automated email from the ASF dual-hosted git repository.
mmarshall pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.8 by this push:
new 2ff4848c1c0 [fix][broker] Make ServerCnx#originalAuthData volatile
(#19507)
2ff4848c1c0 is described below
commit 2ff4848c1c07ab6e6e941e3e37ef1a8116b9840e
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)
(cherry picked from commit f8de0fb5c92ed65ae2b890de381962de8ed4a5ad)
---
.../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 ef6ae823c03..a09b8b823e4 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
@@ -166,7 +166,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
AuthenticationState originalAuthState;
- AuthenticationDataSource originalAuthData;
+ volatile AuthenticationDataSource originalAuthData;
private boolean pendingAuthChallengeResponse = false;
// Max number of pending requests per connections. If multiple producers
are sharing the same connection the flow