You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Bhagyashree (Jira)" <ji...@apache.org> on 2024/06/27 05:07:00 UTC

[jira] [Created] (KAFKA-17044) Connector worker does not shutdown until start completes

Bhagyashree created KAFKA-17044:
-----------------------------------

             Summary: Connector worker does not shutdown until start completes 
                 Key: KAFKA-17044
                 URL: https://issues.apache.org/jira/browse/KAFKA-17044
             Project: Kafka
          Issue Type: Bug
          Components: connect
            Reporter: Bhagyashree


We have identified a gap in the shutdown flow for the connector worker. If the connector is in INIT state and still executing the WorkerConnector::doStart method, a DELETE API call would invoke the WorkerConnector::shutdown and notify() but the connector worker would not shutdown immediately. This happens because start() is a blocking call and the control reaches wait() in doRun() after the start() call has completed. This results in a gap in the delete flow where the connector is not immediately shutdown leaving the resources running. start() keeps running and only when the execution of start() completes, we reach at the point of wait() and then doShutdown() of the connector worker is invoked.
This seems similar to what has been identified for connector tasks as part of https://issues.apache.org/jira/browse/KAFKA-14725.
*Steps to repro*
1. Start a connector with time taking operation in connector.start() call
2. Call DELETE API to delete this connector
3. The connector would be deleted only after the start() completes.

The issue was observed when a connector was configured to retry a db connection for sometime. 
{*}Current Behaviour{*}: The connector did not shutdown until it exhausted the retry count.
{*}Expected Behaviou{*}r: The connector should abort what it is doing and shutdown as requested by the Delete call.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)