-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Core: Close FileIO on cache eviction to prevent thread leaks #15910
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -98,6 +98,13 @@ public void onRemoval(TableIdentifier tableIdentifier, Table table, RemovalCause | |
| if (RemovalCause.EXPIRED.equals(cause)) { | ||
| if (!MetadataTableUtils.hasMetadataTableName(tableIdentifier)) { | ||
| tableCache.invalidateAll(metadataTableIdentifiers(tableIdentifier)); | ||
| if (table != null) { | ||
| try { | ||
| table.io().close(); | ||
| } catch (Exception e) { | ||
| LOG.warn("Failed to close FileIO for evicted table {}", tableIdentifier, e); | ||
| } | ||
|
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 may not be safe for all catalogs. e.g. HadoopCatalog creates a common fileIO at the catalog level and not table level. The same fileIO reference is shared with the table object. So the
close()here would break tables in the catalog that are still actively used.Can this be just handled as part of the catalog's
close()instead?