[fix][broker] Fix get topic policies as null during clean cache#20763
Merged
codelipenghui merged 4 commits intoapache:masterfrom Jul 12, 2023
Merged
[fix][broker] Fix get topic policies as null during clean cache#20763codelipenghui merged 4 commits intoapache:masterfrom
codelipenghui merged 4 commits intoapache:masterfrom
Conversation
64d1f54 to
7d39b82
Compare
7d39b82 to
295ad12
Compare
| } | ||
|
|
||
| @Test | ||
| public void testGetTopicPoliciesWithCleanCache() |
Contributor
There was a problem hiding this comment.
@coderzc Can you reproduce the issue with this test with the fix? I have tried it on my laptop without this fix. But can't reproduce the issue. The fix looks good, just the test can't protect the changes of this PR.
Member
Author
There was a problem hiding this comment.
I have rewritten the test to make it can reproduce the issue.
| }); | ||
| } | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
can you delete the blank line?
mattisonchao
approved these changes
Jul 12, 2023
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20763 +/- ##
=============================================
+ Coverage 36.80% 73.11% +36.31%
- Complexity 12073 32128 +20055
=============================================
Files 1689 1866 +177
Lines 129387 139041 +9654
Branches 14120 15294 +1174
=============================================
+ Hits 47619 101661 +54042
+ Misses 75482 29322 -46160
- Partials 6286 8058 +1772
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
Jul 12, 2023
Technoboy-
pushed a commit
that referenced
this pull request
Jul 17, 2023
Technoboy-
pushed a commit
that referenced
this pull request
Aug 17, 2023
Technoboy-
pushed a commit
that referenced
this pull request
Aug 17, 2023
coderzc
added a commit
that referenced
this pull request
Aug 22, 2023
(cherry picked from commit 3116abf)
coderzc
added a commit
that referenced
this pull request
Aug 28, 2023
(cherry picked from commit 3116abf)
coderzc
added a commit
that referenced
this pull request
Aug 29, 2023
(cherry picked from commit 3116abf)
coderzc
added a commit
that referenced
this pull request
Aug 29, 2023
(cherry picked from commit 3116abf)
mukesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 13, 2024
…he (apache#20763)" This reverts commit 111c14d. (cherry picked from commit ab9384b)
mukesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 19, 2024
…he (apache#20763)" This reverts commit 111c14d. (cherry picked from commit ab9384b)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 23, 2024
…he (apache#20763)" This reverts commit 111c14d. (cherry picked from commit ab9384b)
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.
Motivation
Currently, we may get topic policies as null during the clean topic policies since there is a race condition between them.
getTopicPoliciescleanCacheAndCloseReaderthe value of this namespace
policyCacheInitMap is
truefrom policiesCache as
nullModifications
Use
policyCacheInitMap.compute()to make get topic policies init flag and clean cache mutually exclusive.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: