[fix][broker] Make authentication refresh threadsafe - #19506
Merged
lhotari merged 5 commits intoFeb 14, 2023
Merged
Conversation
michaeljmarshall
requested review from
cbornet,
codelipenghui,
eolivelli,
lhotari,
nicoloboschi,
nodece and
yjshen
February 13, 2023 20:13
Member
Author
|
/pulsarbot rerun-failure-checks |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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.
🚀 New features to boost your workflow:
|
codelipenghui
approved these changes
Feb 14, 2023
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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