You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Bob Cotton <bc...@rallydev.com> on 2012/11/09 17:17:00 UTC

Invalid KafkaStreams as a result of Decoder problems

During the implementation of a custom Encoder/Decoder we noticed that
should the Decoder throw an exception, the KafkaStream that it is in use
becomes invalid.

Searching the mailing list indicates that the only way to recover from an
invalid stream is to shutdown the whole high-level consumer and restart.

Is there a better way to recover from this?

Thanks for the responsiveness on the mailing list.
- Bob

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Neha Narkhede <ne...@gmail.com>.
I meant the former.

Thanks,
Neha

On Tue, Nov 13, 2012 at 10:03 AM, Jason Rosenberg <jb...@squareup.com> wrote:
> Neha,
>
> If I understand correctly, are you saying that it should be possible to
> re-create KafkaStreams, without having to create a new ConsumerConnector?
>
> Or are you saying that we should never get an exception when iterating over
> a KafkaStream (e.g. the underlying implementation should just either
> cleanly shutdown the stream, or should silently repair the stream and
> continue on?).
>
> I thought I'd clarify this before filing a Jira.....
>
> Jason
>
>
> On Tue, Nov 13, 2012 at 9:27 AM, Neha Narkhede <ne...@gmail.com>wrote:
>
>> Bob/Jason,
>>
>> This is a bug. Ideally, we should allow restarting the consumer
>> streams when they encounter an error.
>> Can you file a JIRA ?
>>
>> Thanks,
>> Neha
>>
>> On Mon, Nov 12, 2012 at 6:31 AM, Bob Cotton <bc...@rallydev.com> wrote:
>> > Handling the exceptions in the Decoder is not a problem.
>> >
>> > It was just a larger question about what to do in the event the stream
>> gets
>> > into a failed state.
>> >
>> > Thanks
>> > - Bob
>> >
>> >
>> > On Sun, Nov 11, 2012 at 11:01 PM, Jun Rao <ju...@gmail.com> wrote:
>> >
>> >> Currently, the code in Kafka doesn't expect the decoder to throw
>> >> exceptions. Could you write your decoder to return null on exceptions?
>> >>
>> >> Thanks,
>> >>
>> >> Jun
>> >>
>> >>  On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com>
>> wrote:
>> >>
>> >>> During the implementation of a custom Encoder/Decoder we noticed that
>> >>> should the Decoder throw an exception, the KafkaStream that it is in
>> use
>> >>> becomes invalid.
>> >>>
>> >>> Searching the mailing list indicates that the only way to recover from
>> an
>> >>> invalid stream is to shutdown the whole high-level consumer and
>> restart.
>> >>>
>> >>> Is there a better way to recover from this?
>> >>>
>> >>> Thanks for the responsiveness on the mailing list.
>> >>> - Bob
>> >>>
>> >>
>> >>
>>

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Jason Rosenberg <jb...@squareup.com>.
Neha,

If I understand correctly, are you saying that it should be possible to
re-create KafkaStreams, without having to create a new ConsumerConnector?

Or are you saying that we should never get an exception when iterating over
a KafkaStream (e.g. the underlying implementation should just either
cleanly shutdown the stream, or should silently repair the stream and
continue on?).

I thought I'd clarify this before filing a Jira.....

Jason


On Tue, Nov 13, 2012 at 9:27 AM, Neha Narkhede <ne...@gmail.com>wrote:

> Bob/Jason,
>
> This is a bug. Ideally, we should allow restarting the consumer
> streams when they encounter an error.
> Can you file a JIRA ?
>
> Thanks,
> Neha
>
> On Mon, Nov 12, 2012 at 6:31 AM, Bob Cotton <bc...@rallydev.com> wrote:
> > Handling the exceptions in the Decoder is not a problem.
> >
> > It was just a larger question about what to do in the event the stream
> gets
> > into a failed state.
> >
> > Thanks
> > - Bob
> >
> >
> > On Sun, Nov 11, 2012 at 11:01 PM, Jun Rao <ju...@gmail.com> wrote:
> >
> >> Currently, the code in Kafka doesn't expect the decoder to throw
> >> exceptions. Could you write your decoder to return null on exceptions?
> >>
> >> Thanks,
> >>
> >> Jun
> >>
> >>  On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com>
> wrote:
> >>
> >>> During the implementation of a custom Encoder/Decoder we noticed that
> >>> should the Decoder throw an exception, the KafkaStream that it is in
> use
> >>> becomes invalid.
> >>>
> >>> Searching the mailing list indicates that the only way to recover from
> an
> >>> invalid stream is to shutdown the whole high-level consumer and
> restart.
> >>>
> >>> Is there a better way to recover from this?
> >>>
> >>> Thanks for the responsiveness on the mailing list.
> >>> - Bob
> >>>
> >>
> >>
>

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Neha Narkhede <ne...@gmail.com>.
Bob/Jason,

This is a bug. Ideally, we should allow restarting the consumer
streams when they encounter an error.
Can you file a JIRA ?

Thanks,
Neha

On Mon, Nov 12, 2012 at 6:31 AM, Bob Cotton <bc...@rallydev.com> wrote:
> Handling the exceptions in the Decoder is not a problem.
>
> It was just a larger question about what to do in the event the stream gets
> into a failed state.
>
> Thanks
> - Bob
>
>
> On Sun, Nov 11, 2012 at 11:01 PM, Jun Rao <ju...@gmail.com> wrote:
>
>> Currently, the code in Kafka doesn't expect the decoder to throw
>> exceptions. Could you write your decoder to return null on exceptions?
>>
>> Thanks,
>>
>> Jun
>>
>>  On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com> wrote:
>>
>>> During the implementation of a custom Encoder/Decoder we noticed that
>>> should the Decoder throw an exception, the KafkaStream that it is in use
>>> becomes invalid.
>>>
>>> Searching the mailing list indicates that the only way to recover from an
>>> invalid stream is to shutdown the whole high-level consumer and restart.
>>>
>>> Is there a better way to recover from this?
>>>
>>> Thanks for the responsiveness on the mailing list.
>>> - Bob
>>>
>>
>>

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Bob Cotton <bc...@rallydev.com>.
Handling the exceptions in the Decoder is not a problem.

It was just a larger question about what to do in the event the stream gets
into a failed state.

Thanks
- Bob


On Sun, Nov 11, 2012 at 11:01 PM, Jun Rao <ju...@gmail.com> wrote:

> Currently, the code in Kafka doesn't expect the decoder to throw
> exceptions. Could you write your decoder to return null on exceptions?
>
> Thanks,
>
> Jun
>
>  On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com> wrote:
>
>> During the implementation of a custom Encoder/Decoder we noticed that
>> should the Decoder throw an exception, the KafkaStream that it is in use
>> becomes invalid.
>>
>> Searching the mailing list indicates that the only way to recover from an
>> invalid stream is to shutdown the whole high-level consumer and restart.
>>
>> Is there a better way to recover from this?
>>
>> Thanks for the responsiveness on the mailing list.
>> - Bob
>>
>
>

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Jun Rao <ju...@gmail.com>.
Currently, the code in Kafka doesn't expect the decoder to throw
exceptions. Could you write your decoder to return null on exceptions?

Thanks,

Jun

On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com> wrote:

> During the implementation of a custom Encoder/Decoder we noticed that
> should the Decoder throw an exception, the KafkaStream that it is in use
> becomes invalid.
>
> Searching the mailing list indicates that the only way to recover from an
> invalid stream is to shutdown the whole high-level consumer and restart.
>
> Is there a better way to recover from this?
>
> Thanks for the responsiveness on the mailing list.
> - Bob
>

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Bob Cotton <bc...@rallydev.com>.
Here's the post I saw:
http://mail-archives.apache.org/mod_mbox/incubator-kafka-users/201201.mbox/%3CCAOG_4QbzXPJujmOjLuiHOspLfCkA+-gQP2CkN+J-zyg=kN72hw@mail.gmail.com%3E


On Fri, Nov 9, 2012 at 10:22 AM, Jason Rosenberg <jb...@squareup.com> wrote:

> Wow, this seems a bit restrictive.  Can you point me to the discussion on
> this?  What exactly is an "invalid stream", how can you test for this?
>
> Jason
>
>
> On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com> wrote:
>
>> During the implementation of a custom Encoder/Decoder we noticed that
>> should the Decoder throw an exception, the KafkaStream that it is in use
>> becomes invalid.
>>
>> Searching the mailing list indicates that the only way to recover from an
>> invalid stream is to shutdown the whole high-level consumer and restart.
>>
>> Is there a better way to recover from this?
>>
>> Thanks for the responsiveness on the mailing list.
>> - Bob
>>
>
>

Re: Invalid KafkaStreams as a result of Decoder problems

Posted by Jason Rosenberg <jb...@squareup.com>.
Wow, this seems a bit restrictive.  Can you point me to the discussion on
this?  What exactly is an "invalid stream", how can you test for this?

Jason

On Fri, Nov 9, 2012 at 8:17 AM, Bob Cotton <bc...@rallydev.com> wrote:

> During the implementation of a custom Encoder/Decoder we noticed that
> should the Decoder throw an exception, the KafkaStream that it is in use
> becomes invalid.
>
> Searching the mailing list indicates that the only way to recover from an
> invalid stream is to shutdown the whole high-level consumer and restart.
>
> Is there a better way to recover from this?
>
> Thanks for the responsiveness on the mailing list.
> - Bob
>