Skip to content

Conversation

@AROP-REPLICATION
Copy link
Contributor

Fixes #24389

Motivation

fix resource leak using try-catch stmt methoned in #24389 , and close other leaks in this project I've found later

Modifications

use try-with stmt to close the resoure in:

  • AutoClusterFailover.java
  • RuntimeUtils.java
  • FunctionActioner.java
  • ComponentImpl.java
  • LoadSimulationController.java

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 10, 2025
@BewareMyPower BewareMyPower changed the title [fix] Fix some potential resource leak [fix][client\ Fix some potential resource leak Jun 10, 2025
@BewareMyPower BewareMyPower changed the title [fix][client\ Fix some potential resource leak [fix][client] Fix some potential resource leak Jun 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.

Project coverage is 74.22%. Comparing base (bbc6224) to head (0ea0c8e).
Report is 1140 commits behind head on master.

Files with missing lines Patch % Lines
.../apache/pulsar/functions/runtime/RuntimeUtils.java 0.00% 5 Missing ⚠️
...apache/pulsar/client/impl/AutoClusterFailover.java 0.00% 2 Missing ⚠️
...ulsar/functions/worker/rest/api/ComponentImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24402      +/-   ##
============================================
+ Coverage     73.57%   74.22%   +0.65%     
- Complexity    32624    32664      +40     
============================================
  Files          1877     1868       -9     
  Lines        139502   145321    +5819     
  Branches      15299    16622    +1323     
============================================
+ Hits         102638   107868    +5230     
+ Misses        28908    28898      -10     
- Partials       7956     8555     +599     
Flag Coverage Δ
inttests 26.74% <0.00%> (+2.15%) ⬆️
systests 23.29% <18.18%> (-1.03%) ⬇️
unittests 73.72% <18.18%> (+0.87%) ⬆️

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

Files with missing lines Coverage Δ
...ache/pulsar/functions/worker/FunctionActioner.java 75.43% <100.00%> (+0.50%) ⬆️
...apache/pulsar/client/impl/AutoClusterFailover.java 66.66% <0.00%> (+2.02%) ⬆️
...ulsar/functions/worker/rest/api/ComponentImpl.java 48.40% <0.00%> (+0.38%) ⬆️
.../apache/pulsar/functions/runtime/RuntimeUtils.java 80.00% <0.00%> (+0.61%) ⬆️

... and 1081 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.

@codelipenghui codelipenghui merged commit bfee7a6 into apache:master Jun 10, 2025
97 of 100 checks passed
@AROP-REPLICATION AROP-REPLICATION deleted the rl branch June 12, 2025 01:03
lhotari pushed a commit that referenced this pull request Jun 19, 2025
Fix resource leak using try-catch stmt method in #24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
lhotari pushed a commit that referenced this pull request Jun 19, 2025
Fix resource leak using try-catch stmt method in #24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
lhotari pushed a commit that referenced this pull request Jun 19, 2025
Fix resource leak using try-catch stmt method in #24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
nodece pushed a commit to nodece/pulsar that referenced this pull request Jun 20, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 20, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
(cherry picked from commit dea3e57)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 21, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
(cherry picked from commit 88c4482)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 24, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
(cherry picked from commit 88c4482)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 30, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later

(cherry picked from commit bfee7a6)
(cherry picked from commit dea3e57)
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
Fix resource leak using try-catch stmt method in apache#24389, and close other leaks in this project I've found later
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.

Potential resource leak in LoadSimulationController

6 participants