[fix][proxy] Fix proxy OOM by replacing TopicName with a simple conversion method#24465
Merged
poorbarcode merged 5 commits intoapache:masterfrom Jul 2, 2025
Merged
Conversation
4 tasks
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/LookupProxyHandler.java
Outdated
Show resolved
Hide resolved
3 tasks
nodece
approved these changes
Jun 26, 2025
Member
nodece
left a comment
There was a problem hiding this comment.
LGTM, I think we can move toFullTopicName to the TopicName class.
Contributor
Author
Yes. But let's keep it in |
Contributor
Author
|
I changed my idea and moved the method to |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24465 +/- ##
============================================
+ Coverage 73.57% 74.28% +0.71%
- Complexity 32624 32765 +141
============================================
Files 1877 1868 -9
Lines 139502 145547 +6045
Branches 15299 16657 +1358
============================================
+ Hits 102638 108126 +5488
+ Misses 28908 28863 -45
- Partials 7956 8558 +602
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3pacccccc
reviewed
Jun 26, 2025
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java
Show resolved
Hide resolved
3pacccccc
approved these changes
Jun 26, 2025
dao-jun
approved these changes
Jun 30, 2025
codelipenghui
approved these changes
Jul 1, 2025
poorbarcode
approved these changes
Jul 2, 2025
4 tasks
Technoboy-
pushed a commit
that referenced
this pull request
Jul 17, 2025
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 22, 2025
…rsion method (apache#24465) (cherry picked from commit ae050b9) (cherry picked from commit 425280c)
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 22, 2025
…rsion method (apache#24465) (cherry picked from commit 68f15ce)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 23, 2025
…rsion method (apache#24465) (cherry picked from commit ae050b9) (cherry picked from commit 425280c)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 24, 2025
…rsion method (apache#24465) (cherry picked from commit 68f15ce)
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Jul 28, 2025
…rsion method (apache#24465) (cherry picked from commit ae050b9)
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Jul 28, 2025
…rsion method (apache#24465) (cherry picked from commit ae050b9)
KannarFr
pushed a commit
to CleverCloud/pulsar
that referenced
this pull request
Sep 22, 2025
walkinggo
pushed a commit
to walkinggo/pulsar
that referenced
this pull request
Oct 8, 2025
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 #24445
Motivation
See #24458 for details. However
After reviewing the usages of
TopicNameinpulsar-proxymodule, I found the only case is to convert a user-provided topic to the full topic name. UsingTopicNamehas many unnecessary overhead like parsing aNamespaceName(see the cost from the benchmark here), or maintaining theTopicNameobject in a global cache that requires a thread-safe access viaConcurrentHashMap.Modifications
Introduce a new method
TopicName#toFullTopicNamefor the purpose ofTopicNameinpulsar-proxymodule. Instead of using a global cache, just call this method directly for the conversion.It does not introduce any new configuration. From the benchmark, it's only 2.2x slower than the
TopicName#get, when there are only 200k keys. But it's faster thanTopicName#get.However, it saves memory and the performance should be acceptable that it can be executed 8.5 millions in 1 second.
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: BewareMyPower#46