You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/03/20 21:23:13 UTC
[PR] [fix][test] Fix thread leaks in ManagedLedgerTest and PulsarMockBookKeeper [pulsar]
merlimat opened a new pull request, #25377:
URL: https://github.com/apache/pulsar/pull/25377
## Summary
- **ManagedLedgerTest**: Two test methods (`testNonDurableCursorCreateForInactiveLedger` and `testNoOrphanScheduledTasksAfterCloseML`) created local `ManagedLedgerFactoryImpl` instances that were never shut down, leaking ~10 threads (OrderedScheduler + cache eviction executor). Fixed by adding `@Cleanup("shutdown")`, consistent with other test methods in the same class.
- **PulsarMockBookKeeper**: `shutdown()` used `scheduler.shutdown()` (graceful) which doesn't force thread termination. Changed to `shutdownNow()` so the mock BK scheduler thread terminates immediately during test cleanup.
## Documentation
- [ ] `doc-required`
- [x] `doc-not-needed`
- [ ] `doc-complete`
## Matching PR in forked repository
_none_
### Documentation Checklist
- [x] This PR does not require documentation changes
---
> [!NOTE]
> Ready to test
_Labels: `area/test`_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix thread leaks in ManagedLedgerTest and PulsarMockBookKeeper [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25377:
URL: https://github.com/apache/pulsar/pull/25377
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix thread leaks in ManagedLedgerTest and PulsarMockBookKeeper [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25377:
URL: https://github.com/apache/pulsar/pull/25377#issuecomment-4101258076
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/25377?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 72.73%. Comparing base ([`a3ae705`](https://app.codecov.io/gh/apache/pulsar/commit/a3ae70545f3aef40e8f5cfcced907e6500b08894?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`515aa29`](https://app.codecov.io/gh/apache/pulsar/commit/515aa2932ab390af7513fd6631f7a141f417cf8d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 2 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/25377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #25377 +/- ##
============================================
+ Coverage 72.52% 72.73% +0.21%
+ Complexity 34275 34252 -23
============================================
Files 1927 1954 +27
Lines 154339 154792 +453
Branches 17683 17731 +48
============================================
+ Hits 111935 112594 +659
+ Misses 33389 33154 -235
- Partials 9015 9044 +29
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/25377/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/25377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `25.85% <ø> (-0.18%)` | :arrow_down: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/25377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `22.49% <ø> (?)` | |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/25377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.73% <ø> (-0.02%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
[see 171 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/25377/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org