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

Chris Riccomini commented on SAMZA-87:
--------------------------------------

One thought: I was thinking that getNextOffset would run a TopicMetadataRequest 
against the SimpleConsumer. In fact, it runs an OffsetRequest instead.

I am not sure how a broker behaves if it's not the leader for the 
topic/partition in question. If it returns an error code, we won't get the 
offset back. In such a case, GetOffset.getNextOffset would throw an exception, 
since no offset would be returned. This would, in turn, trigger an exception up 
the stack through BrokerProxy.handleErrors, which is called from 
BrokerProxy.fetchMessages. fetchMessages is wrapped in a try/catch, which will 
catch the SamzaException as a Throwable, re-create the SimpleConsumer, and try 
again.

I think this will leave to an infinite loop. If we get a 
broker-not-owner-of-partition errorCode from the fetch request, we should 
properly abdicate the topic/partition in this case. We should also have a look 
at handling any other errorCodes that are returned from OffsetRequest, so we 
can get a better exception in the logs.

> BrokerProxy doesn't properly handle offset out of range exceptions
> ------------------------------------------------------------------
>
>                 Key: SAMZA-87
>                 URL: https://issues.apache.org/jira/browse/SAMZA-87
>             Project: Samza
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Jakob Homan
>            Assignee: Jakob Homan
>            Priority: Critical
>             Fix For: 0.7.0
>
>         Attachments: SAMZA-87-2.patch, SAMZA-87.patch
>
>
> Currently BrokerProxy will throw an exception for offset out of range from 
> Kafka but does not get a new offset, instead going into an infinite loop of 
> sadness.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to