-
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][broker] normalize path #23438
[fix][broker] normalize path #23438
Conversation
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
I'm not against making this change. Just one question: Technically a path like /app/pulsar/20241011165422044/./interceptors/pulsar-xxx.nar is correct. What is the error message in this case? |
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23438 +/- ##
============================================
+ Coverage 73.57% 74.32% +0.75%
- Complexity 32624 34452 +1828
============================================
Files 1877 1953 +76
Lines 139502 147177 +7675
Branches 15299 16204 +905
============================================
+ Hits 102638 109389 +6751
- Misses 28908 29358 +450
- Partials 7956 8430 +474
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 50dc521)
@nodece Please don't modify the milestone. It will mess up tracking since the code freeze has already started. I can cherry-pick this to branch-4.0. Please read https://lists.apache.org/thread/xtnd51oy8ytmbtrctpmlpg2cqpjgf957 |
Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 50dc521)
Motivation
In the broker configuration, we're using relative paths for parameters such as
brokerInterceptorsDirectory
,protocolHandlerDirectory
,additionalServletDirectory
, andoffloadersDirectory
. These paths include the./
notation, and since the broker doesn't normalize them, the absolute paths generated are incorrect, for example:/app/pulsar/20241011165422044/./interceptors/pulsar-xxx.nar
. As a result, the broker is unable to resolve the correct file locations.Test cases:
Modifications
java.nio.file.Path#normalize
call after thejava.nio.file.Path#toAbsolutePath
call to ensure proper path resolution.Documentation
doc
doc-required
doc-not-needed
doc-complete