jenkinsci / lib-file-leak-detector

Java agent that detects file handle leak
http://file-leak-detector.kohsuke.org/
MIT License
241 stars 112 forks source link

Add Selector support #34

Closed dwnusbaum closed 6 years ago

dwnusbaum commented 6 years ago

Based on top of #33 to pick up useful pom changes and validate against the extra tests. I am happy to submit a PR against master with only my commits if desired.

This is not going to be completely accurate, as what file descriptors are opened by a selector vary from platform to platform, but is simpler than transforming all of the different native classes to track each descriptor separately. For example, EPollSelectorImpl on Linux will open 2 pipes and an anonymous inode for event polling, but this PR only tracks it as a single descriptor.

This seems ok to me, since those file descriptors will be opened and closed together anyway (barring any JDK bugs), and once you know that you are leaking Selectors you can figure out exactly what file descriptors are being created on your platform for each Selector.

@reviewbybees

ghost commented 6 years ago

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

oleg-nenashev commented 6 years ago

Cannot assign myself as a reviewer, but I will try to review it next week

dwnusbaum commented 6 years ago

@reviewbybees done