[ 
https://issues.apache.org/jira/browse/KAFKA-3335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15290333#comment-15290333
 ] 

Shikhar Bhushan commented on KAFKA-3335:
----------------------------------------

Currently {{start()}} looks like

 {code:java}
public void start() {
        try {
            log.info("Kafka Connect starting");
            Runtime.getRuntime().addShutdownHook(shutdownHook);

            herder.start();
            rest.start(herder);

            log.info("Kafka Connect started");
        } finally {
            startLatch.countDown();
        }
    }
 {code}

Would it make sense to only add the shutdown hook at the end of this method?

> Kafka Connect hangs in shutdown hook
> ------------------------------------
>
>                 Key: KAFKA-3335
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3335
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>            Reporter: Ben Kirwin
>
> The `Connect` class can run into issues during start, such as:
> {noformat}
> Exception in thread "main" org.apache.kafka.connect.errors.ConnectException: 
> Could not look up partition metadata for offset backing store topic in 
> allotted period. This could indicate a connectivity issue, unavailable topic 
> partitions, or if this is your first use of the topic it may have taken too 
> long to create.
>         at 
> org.apache.kafka.connect.util.KafkaBasedLog.start(KafkaBasedLog.java:130)
>         at 
> org.apache.kafka.connect.storage.KafkaOffsetBackingStore.start(KafkaOffsetBackingStore.java:85)
>         at org.apache.kafka.connect.runtime.Worker.start(Worker.java:108)
>         at org.apache.kafka.connect.runtime.Connect.start(Connect.java:56)
>         at 
> org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:62)
> {noformat}
> This exception halts the startup process. It also triggers the shutdown 
> hook... which blocks waiting for the service to start up before calling stop. 
> This causes the process to hang forever.
> There's a few things that could be done here, but it would be nice to bound 
> the amount of time the process spends trying to exit gracefully.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to