Skip to content

Conversation

@lhotari
Copy link
Member

@lhotari lhotari commented Jan 14, 2026

Fixes #25138

Motivation

There's a memory leak in Pulsar Proxy's ParserProxyHandler which is used for development / debugging purposes.

Modifications

  • Replace the usages of static final maps that leaked instances
  • Handle closing of producers and consumers.
  • Clear topic stats when proxy log level is set to a value < 2
  • Deduplicate topic name instances in the per-connection producerIdToTopicName/consumerIdToTopicName maps

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari force-pushed the lh-fix-ParserProxyHandler-memory-leak branch from 344ea2f to 658fbc3 Compare January 14, 2026 13:45
@Technoboy- Technoboy- added this to the 4.2.0 milestone Jan 14, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 87.03704% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.41%. Comparing base (1708933) to head (4a5c3d6).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...apache/pulsar/proxy/server/ParserProxyHandler.java 85.71% 5 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #25142       +/-   ##
=============================================
+ Coverage     36.42%   74.41%   +37.98%     
- Complexity    13094    33605    +20511     
=============================================
  Files          1706     1902      +196     
  Lines        140911   150075     +9164     
  Branches      16351    17470     +1119     
=============================================
+ Hits          51323   111674    +60351     
+ Misses        82571    29474    -53097     
- Partials       7017     8927     +1910     
Flag Coverage Δ
inttests 26.30% <0.00%> (-0.14%) ⬇️
systests 23.00% <0.00%> (?)
unittests 73.94% <87.03%> (+39.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...apache/pulsar/proxy/server/DirectProxyHandler.java 72.88% <100.00%> (+20.11%) ⬆️
...a/org/apache/pulsar/proxy/server/ProxyService.java 80.81% <100.00%> (+30.25%) ⬆️
...apache/pulsar/proxy/server/ParserProxyHandler.java 83.96% <85.71%> (+83.96%) ⬆️

... and 1505 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lhotari lhotari requested a review from Technoboy- January 14, 2026 17:34
@lhotari lhotari merged commit 99fdca8 into apache:master Jan 15, 2026
148 of 153 checks passed
lhotari added a commit that referenced this pull request Jan 16, 2026
lhotari added a commit that referenced this pull request Jan 16, 2026
lhotari added a commit that referenced this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Memory leak in ParserProxy when process a PRODUCER or SUBSCRIBE request in different channel

6 participants