DBZ-519 NullPointerException happened for PAUSED task
PostgresConnectorTask throws java.lang.NullPointerException during commit for PAUSED connector after the restart of Kafka Connect application
This commit is contained in:
parent
42991d260f
commit
8df63e894d
@ -151,7 +151,9 @@ private void createSnapshotProducer(PostgresTaskContext taskContext, SourceInfo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void commit() throws InterruptedException {
|
public void commit() throws InterruptedException {
|
||||||
producer.commit();
|
if (running.get()) {
|
||||||
|
producer.commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright Debezium Authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.debezium.connector.postgresql;
|
||||||
|
|
||||||
|
import io.debezium.doc.FixFor;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integration test for {@link PostgresConnectorTask} class.
|
||||||
|
*/
|
||||||
|
public class PostgresConnectorTaskIT {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@FixFor("DBZ-519")
|
||||||
|
public void shouldNotThrowNullPointerExceptionDuringCommit() throws Exception {
|
||||||
|
PostgresConnectorTask postgresConnectorTask = new PostgresConnectorTask();
|
||||||
|
postgresConnectorTask.commit();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user