You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2026/09/26 16:07:00 UTC

[jira] [Created] (KAFKA-21168) The doBuild methods in Worker do not release resources on failure

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)