Add PointsWriter write timeout back

Was ignored for some reason.
pull/6604/head
Jason Wilder 2016-05-11 12:59:51 -06:00
parent db7d58c867
commit a89a4d6b40
1 changed files with 6 additions and 0 deletions

View File

@ -252,10 +252,16 @@ func (w *PointsWriter) WritePoints(database, retentionPolicy string, consistency
w.statMap.Add(statSubWriteDrop, 1)
}
timeout := time.NewTimer(w.WriteTimeout)
defer timeout.Stop()
for range shardMappings.Points {
select {
case <-w.closing:
return ErrWriteFailed
case <-timeout.C:
w.statMap.Add(statWriteTimeout, 1)
// return timeout error to caller
return ErrTimeout
case err := <-ch:
if err != nil {
return err