Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
refresh mgo session when the iter errors (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
jipperinbham authored Aug 15, 2017
1 parent 4f81eba commit ea2c6c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Bugfixes
- when using MongoDB as a source with tailing enabled and namespace filtering, it was possible for documents
from others collections to be sent down the pipeline, fixed via [#386](https://github.com/compose/transporter/pull/386)
- if transporter lost connection to MongoDB while tailing the oplog, the connection never successfully reconnected, fixed via [#398](https://github.com/compose/transporter/pull/398)

## v0.3.1 [2017-03-24]

Expand Down
2 changes: 1 addition & 1 deletion adaptor/mongodb/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func (r *Reader) tailCollection(c string, mgoSession *mgo.Session, oplogTime bso
}
if iter.Err() != nil {
log.With("path", db).Errorf("error tailing oplog, %s", iter.Err())
// return adaptor.NewError(adaptor.CRITICAL, m.path, fmt.Sprintf("MongoDB error (error reading collection %s)", iter.Err()), nil)
mgoSession.Refresh()
}

query = bson.M{"ts": bson.M{"$gte": oplogTime}}
Expand Down

0 comments on commit ea2c6c4

Please sign in to comment.