-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix leaky segment reference on segment drop #18782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -380,11 +380,11 @@ public void dropSegment(final DataSegment dataSegment) | |
| try (final Closer closer = Closer.create()) { | ||
| final Optional<Segment> oldSegment = cacheManager.acquireCachedSegment(oldSegmentRef); | ||
| long numberOfRows = oldSegment.map(segment -> { | ||
| closer.register(segment); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor nit: the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me the structure seems reasonable, since for regular segments it is doing |
||
| final PhysicalSegmentInspector countInspector = segment.as(PhysicalSegmentInspector.class); | ||
| if (countInspector != null) { | ||
| return countInspector.getNumRows(); | ||
| } | ||
| CloseableUtils.closeAndWrapExceptions(segment); | ||
| return 0; | ||
| }).orElse(0); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unused?