is RequestTimedOut (error code: 7) retryable in producer?

68 views
Skip to first unread message

DeJiang Zhu

unread,
Jan 31, 2015, 8:19:19 AM1/31/15
to us...@kafka.apache.org, kafka-...@googlegroups.com
Hi all,

I'm working on implementing a lua kafka client [1], but I'm getting confused: what does `RequestTimedOut` exactly mean.

At first, from The Kafka Protocal [2], I thought producer should retry when received `RequestTimedOut`.

But later, I found sometimes the messages may have `commited` as well even I got `RequestTimedOut`, while sometimes not

Also, in sarama[3], retry happens only on `UnknownTopicOrPartition, NotLeaderForPartition, LeaderNotAvailable` error code;only `LeaderNotAvailableException` and `NotLeaderForPartitionException` extends `RetryAbleException` in kafka[4]

I wonder did I misunderstood The Kafka Protocal or was I wrong on something else I haven't realized.

Looking forward to a reply. Thank you guys in advance. :)


Evan Huus

unread,
Jan 31, 2015, 1:52:18 PM1/31/15
to DeJiang Zhu, us...@kafka.apache.org, kafka-...@googlegroups.com
Hi there,

As far as I know, RequestTimedOut is returned exclusively when the
`Timeout` value provided in a Produce Request is exceeded. The message
will likely still be committed on the local broker, but it means that
some replicas may not have received it yet. I'm honestly not sure what
the use case is for this particular feature, but perhaps somebody else
can explain.

Sarama's choice to retry on `UnknownTopicOrPartition` is probably
unnecessary - I'm not actually sure that code could ever be hit, since
in that case the same error would be raised earlier probably via the
call to `assignPartitions`. Certainly the two important ones are
`LeaderNotAvailable` and `NotLeaderForPartition`.

Evan
> --
> You received this message because you are subscribed to the Google Groups
> "kafka-clients" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kafka-client...@googlegroups.com.
> To post to this group, send email to kafka-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/kafka-clients.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/kafka-clients/CAEZxTmk8YsF3T%2BENcmoVCidOctnbS6wAa08ap9agFP0B7tOXKA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages