-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][admin] Fix exception loss in getMessageId method #23766
Conversation
@danpi Please add the following content to your PR description and select a checkbox:
|
The reason behind this is that there is a possibility of calling the asyncReadEntry0 method in RangeEntryCacheImpl, where at line 272, a thread switch occurs, causing the exception to be lost. However, in the case of an asynchronous call, if we cannot predict when the thread switch will happen, returning the exception via completeExceptionally instead of throwing it directly might be a better approach. |
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.
LGTM, good catch
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23766 +/- ##
============================================
+ Coverage 73.57% 74.30% +0.73%
+ Complexity 32624 32125 -499
============================================
Files 1877 1838 -39
Lines 139502 143054 +3552
Branches 15299 16232 +933
============================================
+ Hits 102638 106299 +3661
+ Misses 28908 28385 -523
- Partials 7956 8370 +414
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: houbonan <[email protected]> (cherry picked from commit 3d50574)
Co-authored-by: houbonan <[email protected]> (cherry picked from commit 3d50574)
Co-authored-by: houbonan <[email protected]> (cherry picked from commit 3d50574)
Co-authored-by: houbonan <[email protected]> (cherry picked from commit 3d50574) (cherry picked from commit 79e05a2)
Co-authored-by: houbonan <[email protected]> (cherry picked from commit 3d50574) (cherry picked from commit 79e05a2)
Fixes #23765
Motivation
#23765 demonstrated how to reproduce the TimeoutException bug and explained the potential issue. Therefore, this PR aims to fix this problem.
Modifications
Verifying this change
This change added tests and can be verified as follows:
org/apache/pulsar/broker/admin/PersistentTopicsTest.java#testGetMessageById
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: