Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
None
-
None
-
None
Description
We have identified a potential issue in the WorkerConnector class of the Connect framework. Specifically, the close() method is not being called on the connector when the connector fails to start due to various reasons. This omission prevents the connector from releasing any resources that were created or started as part of the start() method. As a result, these resources remain allocated even after the connector has failed to start, leading to resource leakage.
To address this issue, we propose modifying the WorkerConnector class to ensure that the close() method is called on the connector whenever the connector fails to start. This change will allow the connector to properly release its resources, preventing resource leakage.
Steps to Reproduce:
- Initiate a connector that creates or allocates resources (for instance, threads) during the execution of the start() method.
- Generate a problem that, during the start() process, either triggers an exception or invokes the raiseError(Exception e) method of the WorkerConnectorContext.
- Notice that the close() method is not invoked on the connector, resulting in resource leakage, as the stop() method is where the resources are typically closed.
In our scenario, the issue was related to threads not being properly closed. These threads were initiated as part of the start() method in the connector.
Expected Result:
When a connector fails to start, the close() method should be called to allow the connector to release its resources.
Actual Result:
The close() method is not called when a connector fails to start, leading to resource leakage.
Attachments
Issue Links
- relates to
-
KAFKA-13533 Task resources are not cleaned up if task initialization fails
- Open
-
KAFKA-16987 Release connector resources when entering FAILED state
- Open
- links to