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
[FLINK-30840][sql-client] Fix resource leak when creating Executor #21800
Conversation
a3f5573
to
cc9ff5a
Compare
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.
@fsk119 thanks for fixing this! Can use such as 'AutoCloseableRegistry' to unify the release of various resources?If do so, we may easier to handle multiple resources and exception messages
...table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ExecutorImpl.java
Outdated
Show resolved
Hide resolved
...table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ExecutorImpl.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java
Show resolved
Hide resolved
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.
LGTM! only one minor comment
try { | ||
registry.close(); | ||
} catch (Throwable t) { | ||
// ignore |
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.
nit: we'd better log the suppressed exception though it will not cause failure
What is the purpose of the change
We should shut down the executors when failed to creating the Executor. Shut down the ExecutorService can releases used system resources.