Skip to content

Commit e91106c

Browse files
authored
[hotfix] Fix data lake catalog connection resource is not closed in flink catalog. (apache#2087)
1 parent 10eab4f commit e91106c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

fluss-common/src/main/java/org/apache/fluss/metadata/TableChange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
public interface TableChange {
2828

2929
/**
30-
* A table change toadd the column with specified position.
30+
* A table change to add the column with specified position.
3131
*
3232
* <p>It is equal to the following statement:
3333
*

fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/catalog/FlinkCatalog.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public void open() throws CatalogException {
158158
public void close() throws CatalogException {
159159
IOUtils.closeQuietly(admin, "fluss-admin");
160160
IOUtils.closeQuietly(connection, "fluss-connection");
161+
IOUtils.closeQuietly(lakeFlinkCatalog, "fluss-lake-catalog");
161162
}
162163

163164
@Override

fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/lake/LakeFlinkCatalog.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import static org.apache.fluss.utils.Preconditions.checkNotNull;
3737

3838
/** A lake flink catalog to delegate the operations on lake table. */
39-
public class LakeFlinkCatalog {
39+
public class LakeFlinkCatalog implements AutoCloseable {
4040

4141
private final String catalogName;
4242
private final ClassLoader classLoader;
@@ -93,6 +93,13 @@ public DataLakeFormat getLakeFormat() {
9393
return lakeFormat;
9494
}
9595

96+
@Override
97+
public void close() throws Exception {
98+
if (catalog != null) {
99+
catalog.close();
100+
}
101+
}
102+
96103
/**
97104
* Factory for creating Paimon Catalog instances.
98105
*

0 commit comments

Comments
 (0)