Skip to content

Commit

Permalink
[SPARK-4964] use newly available attemptNumber for correct retry beha…
Browse files Browse the repository at this point in the history
…vior
  • Loading branch information
koeninger committed Jan 14, 2015
1 parent 548d529 commit c1bd6d9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ class KafkaRDD[
var requestOffset = part.fromOffset
var iter: Iterator[MessageAndOffset] = null

// TODO broken until SPARK-4014 is resolved and attemptId / attemptNumber is meaningful.
// The idea is to use the provided preferred host, except on task retry atttempts,
// to minimize number of kafka metadata requests
private def connectLeader: SimpleConsumer = {
if (context.attemptId > 0) {
if (context.attemptNumber > 0) {
kc.connectLeader(part.topic, part.partition).fold(
errs => throw new Exception(
s"Couldn't connect to leader for topic ${part.topic} ${part.partition}: " +
Expand Down

0 comments on commit c1bd6d9

Please sign in to comment.