Browse Source

When we get a new leader, check it is connected

If we don't do this we'll foist it off on the flusher, which is legit but means
we waste our retry. We can fail fast here and the resulting behaviour will be
better.
Evan Huus 11 years ago
parent
commit
ac956c0771
1 changed files with 4 additions and 0 deletions
  1. 4 0
      producer.go

+ 4 - 0
producer.go

@@ -367,6 +367,10 @@ func (p *Producer) leaderDispatcher(topic string, partition int32, input chan *M
 			return err
 			return err
 		}
 		}
 
 
+		if _, err = leader.Connected(); err != nil {
+			return err
+		}
+
 		output = p.getBrokerWorker(leader)
 		output = p.getBrokerWorker(leader)
 		return nil
 		return nil
 	}
 	}