[Backport] Fix resource leaks (ComplexColumn and GenericColumn) (#3629)#3649
Conversation
* Remove unused ComplexColumnImpl class * Remove throws IOException from close() in GenericColumn, ComplexColumn, IndexedFloats and IndexedLongs * Use concise try-with-resources syntax in several places * Fix resource leaks (ComplexColumn and GenericColumn) in SegmentAnalyzer, SearchQueryRunner, QueryableIndexIndexableAdapter and QueryableIndexStorageAdapter * Use Closer in Iterable, returned from QueryableIndexIndexableAdapter.getRows(), in order to try to close everything even if closing some parts thew exceptions # Conflicts: # processing/src/main/java/io/druid/segment/QueryableIndexIndexableAdapter.java # processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java # processing/src/main/java/io/druid/segment/column/SimpleColumn.java # processing/src/main/java/io/druid/segment/data/BlockLayoutIndexedLongSupplier.java
|
👍 |
|
The name is "fix resource leaks", but the implementation appears to be just moving things to use try-with-resources or
|
|
@leventov Closer is used extensively, but purposefully avoided for any file that Hadoop indexing may touch. Agree with cheddar this needs to be tested for hadoop |
|
Do we really need to backport this? It doesn't seem like a critical fix, and there is some risk identified. Can we leave it for 0.9.3? (which #3629 is already marked for) |
|
Just asking because we are pretty late in the rc train and would like to stick to critical issues and regressions. |
|
@gianm we have seen 700 000 dangling direct byte buffers on historical nodes, presumably because of these leaks. It leads to GC issues and OOMs, i. e. instability. At Metamarkets are going to use it with 0.9.2 anyway. That is why we are pretty much indifferent is it backported or not, as long as it is already in master (0.9.3 onwards). |
|
we are having issues with garbage collection pauses and occasional OOMs in Druid 0.9.1.1 and would love it if this fix were to make it into the 0.9.2 release |
|
Okay, based on recent comments from @leventov and @sascha-coenen the balance may shift to including this in 0.9.2. Especially since we already decided to upgrade Guice for 0.9.2 in #3222, and we already expect some people to need to adjust hadoop configs there. |
|
I'm soft 👍 on including in 0.9.2-rc2. If nobody disagrees then IMO we should do it and just be on the lookout for people reporting hadoop issues with that version. We can also run it through the hadoop testing system we have been building here. |
|
I ran our hadoop-gauntlet tests on this branch and they all passed:
So I'm 👍 on backport. |
|
Thanks @gianm! |
|
Great! thanks a lot @gianm! |
Backport of #3629
Remove unused ComplexColumnImpl class
Remove throws IOException from close() in GenericColumn, ComplexColumn, IndexedFloats and IndexedLongs
Use concise try-with-resources syntax in several places
Fix resource leaks (ComplexColumn and GenericColumn) in SegmentAnalyzer, SearchQueryRunner, QueryableIndexIndexableAdapter and QueryableIndexStorageAdapter
Use Closer in Iterable, returned from QueryableIndexIndexableAdapter.getRows(), in order to try to close everything even if closing some parts thew exceptions