You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jun Rao (Created) (JIRA)" <ji...@apache.org> on 2011/11/09 17:45:52 UTC

[jira] [Created] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Embedded consumer doesn't shut down if the server can't start
-------------------------------------------------------------

                 Key: KAFKA-197
                 URL: https://issues.apache.org/jira/browse/KAFKA-197
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 0.7
            Reporter: Jun Rao


If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.

To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jay Kreps (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13162587#comment-13162587 ] 

Jay Kreps commented on KAFKA-197:
---------------------------------

I don't think we want to call halt(), that is like kill -9 the process. I think we want the logs to flush and shutdown gracefully. Can't we just do a graceful shutdown on both the server and the embedded consumer?
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jay Kreps (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13162616#comment-13162616 ] 

Jay Kreps commented on KAFKA-197:
---------------------------------

A less invasive way would just be to have the embedded consumer register a shutdown hook and use System.exit.

I am a little concerned about this whole embedded consumer thing, though. The original approach where we wrote to the local log in process was pretty fool proof. I think sending to a remote broker is actually riddled with issues. The producer send buffer is vulnerable to quite a large loss on any unclean shutdown or indeed any shutdown bugs. And also any condition that leads to a broker being unable to take requests but still registered in zk will lead to unbounded data loss. I wonder if this issue isn't just a special case of many many bad things that could happen.

With the current approach I actually don't see any benefits at all to bundling the replication process with the kafka broker. It would actually be better to have that run independently it seems to me.
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jun Rao (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao updated KAFKA-197:
--------------------------

    Fix Version/s: 0.7.1
           Status: Patch Available  (was: Open)
    
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jun Rao (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao updated KAFKA-197:
--------------------------

    Attachment: KAFKA-197_v2.patch

Attach patch v2. Consolidate all error handling in KafkaServerStarble.
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch, KAFKA-197_v2.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Neha Narkhede (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13162600#comment-13162600 ] 

Neha Narkhede commented on KAFKA-197:
-------------------------------------

Would it be reasonable to have KafkaServerStartable register a callback with KafkaServer, and have the shutdown API of KafkaServer invoke that callback ? That way, we can ensure that KafkaServerStartable can cleanly shutdown the embedded consumer when the server is shutdown for some reason.
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jun Rao (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao updated KAFKA-197:
--------------------------

    Resolution: Fixed
      Assignee: Jun Rao
        Status: Resolved  (was: Patch Available)

Just committed this.
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>            Assignee: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch, KAFKA-197_v2.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Neha Narkhede (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168067#comment-13168067 ] 

Neha Narkhede commented on KAFKA-197:
-------------------------------------

+1 on v2
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch, KAFKA-197_v2.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jun Rao (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13162922#comment-13162922 ] 

Jun Rao commented on KAFKA-197:
-------------------------------

The main reason that we moved away from writing to local log is to pick up the compression support in the high level producer. Decoupling the embedded consumer from the broker may not be a bad idea. There is one more service/process that one has to manage. However, it's probably more flexible (to support things like consuming from multiple sources and plugging in logic for consumer-side auditing) and is less intrusive to the core Kafka code.
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-197) Embedded consumer doesn't shut down if the server can't start

Posted by "Jun Rao (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao updated KAFKA-197:
--------------------------

    Attachment: KAFKA-197.patch

Patch attached.
                
> Embedded consumer doesn't shut down if the server can't start
> -------------------------------------------------------------
>
>                 Key: KAFKA-197
>                 URL: https://issues.apache.org/jira/browse/KAFKA-197
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Jun Rao
>             Fix For: 0.7.1
>
>         Attachments: KAFKA-197.patch
>
>
> If a broker embeds a consumer and the broker itself doesn't start (e.g., conflicting broker id in ZK), the embedded consumer is still running. In this case, we should probably shut down the embedded consumer too.
> To do this, we need to either throw an exception or return an error in KafkaServer.startup and act accordingly in KafkaServerStartable.startup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira