You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Virendra Pratap Singh <vp...@yahoo-inc.com.INVALID> on 2014/06/20 21:43:57 UTC

General question regarding kakfa behavior when running controlled.shutdown.enable==true

Have a scenario and wanted to understand how Kafka will behave. Will be
trying this out but wanted to check if anyone else has already done this.

Running kafka 0.8.0. The way we launch kafka server is via invoking
kafka.Kafka in one of a separate thread  of our daemon java service
process. 

Kafka runs fine, no issues there.

The scenario is, we now have this property Œcontrolled.shutdown.enable'
(enabled). When we stop our java service, it internally calls
thread.stop() (for the thread which is running kafka). And then exit the
JVM. 

What I want to understand is will the kafka shutdown thread be properly
executed. The reason is, here kafka is not run as a separate jvm instance,
but as a separate thread within a process. And that thread is stopped and
then the the kafka shutdown hook will be executed as part of JVM shutdown
sequence.

Regards,
Virendra




Re: General question regarding kakfa behavior when running controlled.shutdown.enable==true

Posted by Guozhang Wang <wa...@gmail.com>.
The short answer is yes, the shutdown will execute completely in your case.

For details of the controlled shutdown, you can read

https://kafka.apache.org/documentation.html#basic_ops_restarting

Guozhang


On Fri, Jun 20, 2014 at 12:43 PM, Virendra Pratap Singh <
vpsingh@yahoo-inc.com.invalid> wrote:

> Have a scenario and wanted to understand how Kafka will behave. Will be
> trying this out but wanted to check if anyone else has already done this.
>
> Running kafka 0.8.0. The way we launch kafka server is via invoking
> kafka.Kafka in one of a separate thread  of our daemon java service
> process.
>
> Kafka runs fine, no issues there.
>
> The scenario is, we now have this property Œcontrolled.shutdown.enable'
> (enabled). When we stop our java service, it internally calls
> thread.stop() (for the thread which is running kafka). And then exit the
> JVM.
>
> What I want to understand is will the kafka shutdown thread be properly
> executed. The reason is, here kafka is not run as a separate jvm instance,
> but as a separate thread within a process. And that thread is stopped and
> then the the kafka shutdown hook will be executed as part of JVM shutdown
> sequence.
>
> Regards,
> Virendra
>
>
>
>


-- 
-- Guozhang

Re: General question regarding kakfa behavior when running controlled.shutdown.enable==true

Posted by Jun Rao <ju...@gmail.com>.
It depends on how you start Kafka server. If you
do KafkaServerStartable.start(), you will need to call
KafkaServerStartable.shutdown() in your service to trigger the controlled
shutdown logic.

Thanks,

Jun


On Fri, Jun 20, 2014 at 12:43 PM, Virendra Pratap Singh <
vpsingh@yahoo-inc.com.invalid> wrote:

> Have a scenario and wanted to understand how Kafka will behave. Will be
> trying this out but wanted to check if anyone else has already done this.
>
> Running kafka 0.8.0. The way we launch kafka server is via invoking
> kafka.Kafka in one of a separate thread  of our daemon java service
> process.
>
> Kafka runs fine, no issues there.
>
> The scenario is, we now have this property Œcontrolled.shutdown.enable'
> (enabled). When we stop our java service, it internally calls
> thread.stop() (for the thread which is running kafka). And then exit the
> JVM.
>
> What I want to understand is will the kafka shutdown thread be properly
> executed. The reason is, here kafka is not run as a separate jvm instance,
> but as a separate thread within a process. And that thread is stopped and
> then the the kafka shutdown hook will be executed as part of JVM shutdown
> sequence.
>
> Regards,
> Virendra
>
>
>
>