Skip to content

Commit 77785c1

Browse files
authored
[hotfix[cdc-runtime] Close MetadataApplier in SchemaRegistry when the job stops
This closes #3864
1 parent cf95dca commit 77785c1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/schema/common/SchemaRegistry.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
import javax.annotation.Nullable;
4747

48+
import java.io.IOException;
4849
import java.time.Duration;
4950
import java.util.List;
5051
import java.util.Map;
@@ -130,6 +131,12 @@ public void start() throws Exception {
130131
public void close() throws Exception {
131132
LOG.info("Closing SchemaRegistry - {}.", operatorName);
132133
coordinatorExecutor.shutdown();
134+
try {
135+
metadataApplier.close();
136+
} catch (Exception e) {
137+
LOG.error("Failed to close metadata applier.", e);
138+
throw new IOException("Failed to close metadata applier.", e);
139+
}
133140
}
134141

135142
// ------------------------------

0 commit comments

Comments
 (0)