mongodb-erlang
mongodb-erlang copied to clipboard
Support for auto reconnect to mongodb
Does this lib support autoreconnect to the mongodb. I was using this in emqttd_mongodb_auth plugin but i found that if mongodb is shutdown and restarted again library is not reconnecting to mongodb automatically and hence i have to restart the whole application again. But it will be bad if accidentally something happens to the mongodb server and the application does not automatically reconnect to the db. Has anyone implemented auto reconnect ?
if you use mc_worker_api
you have to do reconnect yourself, as workier just dies, when it looses connection to the database.
If you use mongo_api
reconnects should be handled automatically. But it is not always working due to a bug. I know about it but don't have time right now to fix it.
The solution for now is to integrate mc_workers in your own supervision tree and handle reconnects there.
Any update on But it is not always working due to a bug
? Could we have some clue what the bug is and maybe try to help fix?