Retry iterable cursor on bson.Raw unmarshal error
@@ -116,13 +116,13 @@ func (ot *OplogTail) tail() {
if iter.Next(&result) {
oplog := mdbstructs.OplogTimestampOnly{}
err := result.Unmarshal(&oplog)
- if err != nil {
- continue
- }
+ if err == nil {
ot.dataChan <- result.Data
ot.lastOplogTimestamp = &oplog.Timestamp
continue
}
+ iter.Close()
+ }
if iter.Timeout() {
continue
}
