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:
jchipmunk 2017-12-20 17:58:28 +03:00 committed by Jiri Pechanec
parent 42991d260f
commit 8df63e894d
2 changed files with 26 additions and 1 deletions

View File

@ -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

View File

@ -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();
}
}