Update `mongodb` sub-dependency in `mongoose` for stable connection (no timeout errors)
Update mongodb
sub-dependency in mongoose
for hopefully a stable connection (no timeout errors) during the Gitter -> Matrix message import process.
Updating because we're seeing MongoError: connection 10 to mongo-replica-01:27017 timed out
errors for things that don't seem to be hitting the timeouts (they happen too fast). And there is smoke from these other people seeing timeout issues when doing heavy parallel loads which was fixed after updating to a later mongodb
and using the useMongoClient: true
Mongoose option:
-
https://github.com/Automattic/mongoose/issues/4660#issuecomment-259959295
- See https://github.com/Automattic/mongoose/issues/4660#issuecomment-262492345 which calls out our problem
mongoose@4.6.8
andmongodb@2.2.11
versions
- See https://github.com/Automattic/mongoose/issues/4660#issuecomment-262492345 which calls out our problem
- https://github.com/Automattic/mongoose/issues/5376
- https://github.com/Automattic/mongoose/issues/4789#issuecomment-410130496
docs/content/tutorials/connection_failures.md
Related:
Ideally, we could just update mongoose
to the latest 4.x
but that is blocked by the problems described in !1138 / env!9
Dev notes
Our new mongoose
fork:
- https://www.npmjs.com/package/@gitterhq/mongoose
- https://github.com/gitterHQ/mongoose/tree/madlittlemods/4.6.8-updated-mongodb
Install our fork under mongoose
so we don't need to change the imports:
npm install mongoose@npm:@gitterhq/mongoose@4.6.8-updated-mongodb
(don't forget to run scripts/filter-package-lock-json-to-update-graceful-fs-for-gulp.js
after, see instructions in that utility script)
Previous versions:
-
mongoose
: https://github.com/Automattic/mongoose/tree/4.6.8 -
mongodb
: https://github.com/mongodb/node-mongodb-native/tree/V2.2.11 -
mongodb-core
: https://github.com/mongodb-js/mongodb-core/tree/V2.0.13
New versions:
-
mongoose
(same): https://github.com/Automattic/mongoose/tree/4.6.8 -
mongodb
: https://github.com/mongodb/node-mongodb-native/tree/v2.2.36 -
mongodb-core
: https://github.com/mongodb-js/mongodb-core/tree/v2.1.18
Latest mongoose@4.13.21
for reference
mongodb@2.2.x
docs:
- https://mongodb.github.io/node-mongodb-native/2.2/
- https://mongodb.github.io/node-mongodb-native/2.2/api/
Todo
-
Update @gitterhq/env
-
Can we backport the useMongoClient: true
Mongoose option?- -> https://github.com/gitterHQ/mongoose/pull/1
- Originally introduced in https://github.com/Automattic/mongoose/pull/5355