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

Retry on master write failure #8

Closed
auroraeosrose opened this issue Nov 17, 2014 · 3 comments
Closed

Retry on master write failure #8

auroraeosrose opened this issue Nov 17, 2014 · 3 comments

Comments

@auroraeosrose
Copy link

Silly github lost the rest!

Recovering failed connections with replicasets and failover is fairly easy to centralize

But there can be some pretty crazy latency with the rediscovery. If the driver connects to a secondary and later tries a write it will fail.

In this case the write should really be retried. Sure you could do this by wrapping monga in another class (sigh) but it would be far more elegant to simply catch MongoCursorExceptions and look for the "not master" failure for inserts/saves and retry

@bcrowe
Copy link
Member

bcrowe commented Nov 17, 2014

Sounds reasonable to me. I can take a look into this later this evening, or feel free to open a PR yourself if you wish.

@bcrowe
Copy link
Member

bcrowe commented Nov 20, 2014

Closed via d657884 and da2bf82.

@bcrowe bcrowe closed this as completed Nov 20, 2014
@auroraeosrose
Copy link
Author

Awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants