lhotari opened a new pull request, #22660: URL: https://github.com/apache/pulsar/pull/22660
### Motivation When investigating OOM issues in tests, I noticed that some memory leaks were related to references via LoadSheddingTask <img width="1054" alt="image" src="https://github.com/apache/pulsar/assets/66864/1cabfe1b-a269-42e6-b8f4-a3a9564a8052"> There are 2 problems: - the fields aren't accessed in a thread safety way - because of races, it's possible that the task gets started when the instance is already shutting down. ### Modifications - extract methods for cancelling and creating the loadSheddingTask and loadResourceQuotaTask instances - make the methods synchronized to fix the thread safety issue - before creating the instances, check that PulsarService is running ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
