Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover the Mongo connection upon disconnect #472

Merged
merged 7 commits into from Aug 9, 2017
Merged

Conversation

@lushc
Copy link
Member

lushc commented Jul 19, 2017

Closes #122 and #338.

@lushc lushc requested review from OmgImAlexis and simison Jul 19, 2017
cb();
} else {
// no longer recoverable
cb(new Error('MongoDB topology has been destroyed'));

This comment has been minimized.

Copy link
@OmgImAlexis

OmgImAlexis Jul 19, 2017

Member

Since a lot of people aren't going to understand what "topology has been destroyed" means maybe we could provide a nicer error and stick that type of warning in the debug statement in #468?

This comment has been minimized.

Copy link
@lushc

lushc Jul 19, 2017

Author Member

Yep good point, I'll add that in once the other PR has been accepted.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 19, 2017

Coverage Status

Coverage decreased (-0.5%) to 91.054% when pulling 2a9fe4f on feature/auto-reconnect into d8e1da3 on master.

@niftylettuce

This comment has been minimized.

Copy link
Member

niftylettuce commented Jul 21, 2017

Can we please get this in asap? It's causing huge issues in production for me for past several months.

@OmgImAlexis

This comment has been minimized.

Copy link
Member

OmgImAlexis commented Aug 8, 2017

@lushc could you fix this up please? We should be able to merge this in now.

@lushc lushc force-pushed the feature/auto-reconnect branch from 2a9fe4f to 906a089 Aug 8, 2017
@lushc

This comment has been minimized.

Copy link
Member Author

lushc commented Aug 8, 2017

All fixed up 👍

@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.5%) to 80.165% when pulling 906a089 on feature/auto-reconnect into bf98c65 on master.

@simison

This comment has been minimized.

Copy link
Member

simison commented Aug 8, 2017

LGTM 👍

Travis error is unrelated to this PR:

  1) Job job concurrency should run jobs as first in first out (FIFO) with respect to priority:
     Error: Timeout of 8000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

I restarted Travis job and once it passes, I recon this is ready for merging. I'd appreciate if you could add this to change log as well, but doesn't have to be with this PR.

@lushc lushc force-pushed the feature/auto-reconnect branch from 906a089 to ea83055 Aug 8, 2017
@lushc

This comment has been minimized.

Copy link
Member Author

lushc commented Aug 8, 2017

Done!

@simison
simison approved these changes Aug 8, 2017
@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.4%) to 79.835% when pulling 2bc3a29 on feature/auto-reconnect into 9d5f183 on master.

1 similar comment
@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.4%) to 79.835% when pulling 2bc3a29 on feature/auto-reconnect into 9d5f183 on master.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.4%) to 79.835% when pulling 2bc3a29 on feature/auto-reconnect into 9d5f183 on master.

1 similar comment
@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.4%) to 79.835% when pulling 2bc3a29 on feature/auto-reconnect into 9d5f183 on master.

@simison simison requested a review from OmgImAlexis Aug 8, 2017
@OmgImAlexis

This comment has been minimized.

Copy link
Member

OmgImAlexis commented Aug 9, 2017

@lushc could you please add the changes from this to the history.md. This will land in 1.0.0.

Edit: Didn't see the other commit. All's good.

@OmgImAlexis OmgImAlexis merged commit 1f3dc80 into master Aug 9, 2017
4 checks passed
4 checks passed
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.4%) to 79.835%
Details
@OmgImAlexis OmgImAlexis deleted the feature/auto-reconnect branch Aug 9, 2017
@OmgImAlexis OmgImAlexis added this to the 1.0.0 milestone Aug 9, 2017
timelf123 added a commit to ideawake/agenda that referenced this pull request Feb 16, 2018
* Allow the Mongo client to recover after connection loss

* Default to reconnecting "indefinitely" at an interval matching the process tick

* Add the autoReconnect option for verbosity

Defaults to true anyway but this might change in a future driver version

* Update README with a section on recovering lost connections

* Adjust error messages and add debug output

* Add to history changelog

* Update error message in README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.