Skip to content

[fix][broker] Make ServerCnx#originalAuthData volatile#19507

Merged
michaeljmarshall merged 1 commit intoapache:masterfrom
michaeljmarshall:make-authz-check-threadsafe
Feb 14, 2023
Merged

[fix][broker] Make ServerCnx#originalAuthData volatile#19507
michaeljmarshall merged 1 commit intoapache:masterfrom
michaeljmarshall:make-authz-check-threadsafe

Conversation

@michaeljmarshall
Copy link
Copy Markdown
Member

Fixes #19431

Motivation

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.

Modifications

  • Add volatile keyword to ServerCnx#originalAuthData.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Documentation

  • doc-not-needed

Matching PR in forked repository

PR in forked repository: skipping test in fork.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 14, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.25%. Comparing base (016e7f0) to head (67cdc30).
⚠️ Report is 2834 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #19507       +/-   ##
=============================================
+ Coverage     24.75%   62.25%   +37.49%     
- Complexity      288    25744    +25456     
=============================================
  Files          1579     1843      +264     
  Lines        121841   135158    +13317     
  Branches      13304    14856     +1552     
=============================================
+ Hits          30164    84138    +53974     
+ Misses        87240    43285    -43955     
- Partials       4437     7735     +3298     
Flag Coverage Δ
inttests 24.72% <ø> (-0.04%) ⬇️
systests 25.30% <ø> (?)
unittests 59.44% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...va/org/apache/pulsar/broker/service/ServerCnx.java 54.43% <ø> (+22.77%) ⬆️

... and 1403 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@michaeljmarshall michaeljmarshall merged commit c4c1744 into apache:master Feb 14, 2023
@michaeljmarshall michaeljmarshall deleted the make-authz-check-threadsafe branch February 14, 2023 05:37
michaeljmarshall added a commit that referenced this pull request Feb 14, 2023
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 c4c1744)
michaeljmarshall added a commit to datastax/pulsar that referenced this pull request Feb 14, 2023
Fixes apache#19431

`authenticationData` is already `volatile`. We use `originalAuthData` when set, so we should match the style. In apache#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 c4c1744)
(cherry picked from commit e1d9941)
michaeljmarshall added a commit that referenced this pull request Feb 14, 2023
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 c4c1744)
(cherry picked from commit e1d9941)
michaeljmarshall added a commit that referenced this pull request Feb 14, 2023
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 c4c1744)
(cherry picked from commit e1d9941)
michaeljmarshall added a commit that referenced this pull request Feb 14, 2023
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 c4c1744)
(cherry picked from commit e1d9941)
(cherry picked from commit f8de0fb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address thread safety concerns in ServerCnx for auth related data

4 participants