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

Commit ea2c6c4

Browse files
authored
refresh mgo session when the iter errors (#398)
1 parent 4f81eba commit ea2c6c4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
### Bugfixes
99
- when using MongoDB as a source with tailing enabled and namespace filtering, it was possible for documents
1010
from others collections to be sent down the pipeline, fixed via [#386](https://github.com/compose/transporter/pull/386)
11+
- 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)
1112

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

adaptor/mongodb/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ func (r *Reader) tailCollection(c string, mgoSession *mgo.Session, oplogTime bso
292292
}
293293
if iter.Err() != nil {
294294
log.With("path", db).Errorf("error tailing oplog, %s", iter.Err())
295-
// return adaptor.NewError(adaptor.CRITICAL, m.path, fmt.Sprintf("MongoDB error (error reading collection %s)", iter.Err()), nil)
295+
mgoSession.Refresh()
296296
}
297297

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

0 commit comments

Comments
 (0)