[hotfix[cdc-runtime] Close MetadataApplier in SchemaRegistry when the job stops

This closes #3864
pull/3716/head
Leonard Xu 2 weeks ago committed by GitHub
parent cf95dcab64
commit 77785c1c08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,6 +45,7 @@ import org.slf4j.LoggerFactory;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.io.IOException;
import java.time.Duration; import java.time.Duration;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -130,6 +131,12 @@ public abstract class SchemaRegistry implements OperatorCoordinator, Coordinatio
public void close() throws Exception { public void close() throws Exception {
LOG.info("Closing SchemaRegistry - {}.", operatorName); LOG.info("Closing SchemaRegistry - {}.", operatorName);
coordinatorExecutor.shutdown(); coordinatorExecutor.shutdown();
try {
metadataApplier.close();
} catch (Exception e) {
LOG.error("Failed to close metadata applier.", e);
throw new IOException("Failed to close metadata applier.", e);
}
} }
// ------------------------------ // ------------------------------

Loading…
Cancel
Save