Skip to content

Commit

Permalink
Merge pull request apache#589 from lovoo/bugfix/host-mark
Browse files Browse the repository at this point in the history
mark the selected host with the real batch response
  • Loading branch information
Zariel committed Jan 15, 2016
2 parents 4fdf2f5 + def9d19 commit 2fc8e5b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,21 +481,21 @@ func (s *Session) executeBatch(batch *Batch) (*Iter, error) {
iter, err = conn.executeBatch(batch)
batch.totalLatency += time.Now().Sub(t).Nanoseconds()
batch.attempts++
//Exit loop if operation executed correctly

// Update host
host.Mark(err)

// Exit loop if operation executed correctly
if err == nil {
host.Mark(err)
return iter, err
break
}

// Mark host as OK
host.Mark(nil)

if batch.rt == nil || !batch.rt.Attempt(batch) {
break
}
}

return nil, err
return iter, err
}

// ExecuteBatch executes a batch operation and returns nil if successful
Expand Down

0 comments on commit 2fc8e5b

Please sign in to comment.