github-plugin
github-plugin copied to clipboard
Avoid eager Jenkins items lookup in the webhook cleaner.
Use lazy iterable of all items instead of using an eager list of all the items that is stored in a local variable but immediately converted to the iterable.
I was looking through the heap dump in Eclipse MAT. Most of the memory was just taken by the WorkflowRun objects. It caught my attention that the Cleaner thread featured prominently in the Leak report. I looked into it and thought it could be improved a bit. Functionally nothing should change, the thread just no longer directly references all the items for the duration of execution.
I have also taken a chance to refactor the anonymous classes into lambdas in the functional utility class JobInfoHelpers
.
- [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
Bother! Two new SpotBug issues in the files that I didn't even touch 😢
@Vlatombe do you know if maybe these two new unexpected SpotBug issues in NullSafeFunction
and NullSafePredicate
showed up because you changed the annotations recently?
@duemir There are 19 spotbugs issues on master (same as in this PR), even before the annotations change. No idea how spotbugs think these are new.
@KostyaSha maybe you have some ideas or comments?
Bummer! Rebuild didn't help 😞
Yey! SpotBug cleaned up after merging the latest master
.
@KostyaSha maybe you can merge it now.
@lanwen @oleg-nenashev, maybe you can review and merge?