Skip to content

Flink: Close catalog opened by the dynamic sink serializer cache - #17437

Open
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:flink-dynamic-close-catalogs
Open

Flink: Close catalog opened by the dynamic sink serializer cache#17437
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:flink-dynamic-close-catalogs

Conversation

@vishnuprakaz

Copy link
Copy Markdown
Contributor

The dynamic sink's TableSerializerCache loads a catalog with CatalogLoader.loadCatalog() on every cache miss (an unknown schema or spec id, or an LRU eviction) but never closes it. Each call builds a fresh catalog whose resources, such as a REST HTTP client and thread pool or a Hive metastore client pool, are released only on close, so a long-running job that keeps missing the cache leaks connections and threads.

The cache lives inside a Flink TypeSerializer that has no teardown hook, so it now closes the catalog right after reading the table's schemas and specs. This matches how TableLoader closes the catalogs it opens.

@github-actions github-actions Bot added the flink label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant