-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Make authentication refresh threadsafe #19506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lhotari
merged 5 commits into
apache:master
from
michaeljmarshall:make-auth-refresh-thread-safe
Feb 14, 2023
Merged
[fix][broker] Make authentication refresh threadsafe #19506
lhotari
merged 5 commits into
apache:master
from
michaeljmarshall:make-auth-refresh-thread-safe
Feb 14, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
|
/pulsarbot rerun-failure-checks |
Codecov Report
@@ Coverage Diff @@
## master #19506 +/- ##
============================================
- Coverage 63.73% 63.27% -0.47%
- Complexity 26234 26239 +5
============================================
Files 1843 1844 +1
Lines 135158 135238 +80
Branches 14856 14871 +15
============================================
- Hits 86149 85575 -574
- Misses 41176 41897 +721
+ Partials 7833 7766 -67
Flags with carried forward coverage won't be shown. Click here to find out more.
|
codelipenghui
approved these changes
Feb 14, 2023
lhotari
approved these changes
Feb 14, 2023
Member
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @michaeljmarshall
nodece
approved these changes
Feb 14, 2023
2 tasks
michaeljmarshall
added a commit
to michaeljmarshall/pulsar
that referenced
this pull request
Feb 15, 2023
Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com> (cherry picked from commit 153e4d4)
michaeljmarshall
added a commit
that referenced
this pull request
Feb 22, 2023
michaeljmarshall
added a commit
to michaeljmarshall/pulsar
that referenced
this pull request
Feb 22, 2023
michaeljmarshall
added a commit
to michaeljmarshall/pulsar
that referenced
this pull request
Feb 23, 2023
michaeljmarshall
added a commit
to michaeljmarshall/pulsar
that referenced
this pull request
Feb 23, 2023
15 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
cherry-picked/branch-2.8
Archived: 2.8 is end of life
cherry-picked/branch-2.9
Archived: 2.9 is end of life
cherry-picked/branch-2.10
cherry-picked/branch-2.11
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/2.8.5
release/2.9.5
release/2.10.4
release/2.11.1
type/bug
The PR fixed a bug or issue reported a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #19431
Motivation
The
originalAuthStateand theauthStateare not thread safe members of theServerCnxclass. As such, we should only access them on the context's event loop thread.Modifications
ServerCnxthat will run on the appropriate event loop. This logic could theoretically be optimized to minimize scheduled tasks. However, I am following the keep alive implementation and making the assumption that the Netty scheduled tasks are not too expensive.refreshAuthenticationCredentialsmethod to remove the logic that it only short circuits when theServerCnxis inFailedstate. We should never call this method when theisActiveflag has gone tofalse, and the only case when the state isn'tConnectedis when we recently failed due to an exception.Verifying this change
Added new test and make sure existing tests pass. Also, I added some new
assertlines. These only run when the correct JVM arg is passed.Does this pull request potentially affect one of the following parts:
This is not a breaking change.
Documentation
doc-not-neededThis is an internal improvement.
Matching PR in forked repository
PR in forked repository: michaeljmarshall#28