Chia-Ping Tsai created KAFKA-21168:
--------------------------------------
Summary: The doBuild methods in Worker do not release resources on
failure
Key: KAFKA-21168
URL: https://issues.apache.org/jira/browse/KAFKA-21168
Project: Kafka
Issue Type: Bug
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
{code:java}
KafkaProducer<byte[], byte[]> producer = new
KafkaProducer<>(producerProps); TopicAdmin topicAdmin = null;
final boolean topicCreationEnabled =
sourceConnectorTopicCreationEnabled(sourceConfig);
if (topicCreationEnabled ||
regularSourceTaskUsesConnectorSpecificOffsetsStore(sourceConfig)) {
Map<String, Object> adminOverrides =
adminConfigs(id.connector(), "connector-adminclient-" + id, config,
sourceConfig, connectorClass,
connectorClientConfigOverridePolicy, kafkaClusterId, ConnectorType.SOURCE);
topicAdmin = new TopicAdmin(adminOverrides);
} {code}
In the code above, the producer should be closed if any of the following steps
fail. The other doBuild methods have similar issues.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)