{"action":"created","issue":{"url":"https://api.github.com/repos/christkv/mongodb-core/issues/97","repository_url":"https://api.github.com/repos/christkv/mongodb-core","labels_url":"https://api.github.com/repos/christkv/mongodb-core/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/christkv/mongodb-core/issues/97/comments","events_url":"https://api.github.com/repos/christkv/mongodb-core/issues/97/events","html_url":"https://github.com/christkv/mongodb-core/issues/97","id":155282748,"number":97,"title":"Endlessly reconnecting to database since 1.3.19 update","user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-17T15:01:38Z","updated_at":"2016-05-19T08:08:10Z","closed_at":"2016-05-19T08:08:10Z","body":"I just upgraded to mongodb-core 1.3.19 instead of 1.3.18 (+ mongodb 2.1.15) on Mac OS X and the driver is endlessly reconnecting to the database.\r\n\r\nMy code:\r\n\r\n```\r\nMongoClient.connect('http://localhost:27017/test', { poolSize: 10, autoReconnect: true, connectTimeoutMS: 500, socketTimeoutMS: 1000 }, function(err, db) {\r\n    if (err) {\r\n        logger.error(new Error('Cannot connect to Mongo -> stop'));\r\n        process.exit(-1);\r\n    } else {\r\n        logger.info(\"Connected to test database\");\r\n        db.on('close', function() {\r\n            logger.warn('Connection lost to database');\r\n            dbOk = false;\r\n        });\r\n        db.on('reconnect', function() {\r\n            logger.warn('Reconnecting to database');\r\n            dbOk = true;\r\n        });\r\n        entries = db.collection('entries');\r\n        dbOk = true;\r\n    }\r\n});\r\n```\r\n\r\nPreviously, the driver connected to the database and that was all, but now my logs are full of \"Reconnecting to database\"...\r\n\r\nIs there something wrong with the driver v1.3.19?"},"comment":{"url":"https://api.github.com/repos/christkv/mongodb-core/issues/comments/220255745","html_url":"https://github.com/christkv/mongodb-core/issues/97#issuecomment-220255745","issue_url":"https://api.github.com/repos/christkv/mongodb-core/issues/97","id":220255745,"user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T08:08:10Z","updated_at":"2016-05-19T08:08:10Z","body":"Indeed, I removed the `socketTimeoutMS` (so it defaults to 30 seconds) and things are working correctly now. Thanks for your help."}}