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

Crash on database connection failure #2

Open
atrigent opened this issue May 28, 2014 · 1 comment
Open

Crash on database connection failure #2

atrigent opened this issue May 28, 2014 · 1 comment

Comments

@atrigent
Copy link
Member

There's not much the data store API can do without a database connection, and some connection errors (authentication failure, for example) are pretty much unrecoverable. For the ones that are recoverable, we can rely on Heroku's automatic restarting of the app.

@atrigent
Copy link
Member Author

Also: without change e3893cb, some types of connection errors (if I disable my wifi, for example) cause the app to crash with this error:

14:32:59 web.1  | events.js:72
14:32:59 web.1  |         throw er; // Unhandled 'error' event
14:32:59 web.1  |               ^
14:32:59 web.1  | Error: failed to connect to [****.mongolab.com:****]
14:32:59 web.1  |     at null.<anonymous> (/home/atrigent/programming/finalsclub/MIT-Annotation-Data-Store/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:540:74)
14:32:59 web.1  |     at EventEmitter.emit (events.js:106:17)
14:32:59 web.1  |     at null.<anonymous> (/home/atrigent/programming/finalsclub/MIT-Annotation-Data-Store/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
14:32:59 web.1  |     at EventEmitter.emit (events.js:98:17)
14:32:59 web.1  |     at Socket.<anonymous> (/home/atrigent/programming/finalsclub/MIT-Annotation-Data-Store/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:478:10)
14:32:59 web.1  | exited with code 8
14:32:59 system | sending SIGTERM to all processes
14:32:59 web.1  |     at Socket.EventEmitter.emit (events.js:95:17)
14:32:59        |     at net.js:833:16
14:32:59        |     at process._tickCallback (node.js:415:13)

Authentication errors, however, do not cause this crash, and there is in fact no indication that they occurred. I'm not sure why. With the above mentioned commit, all connection errors simply produce a console error. This ticket is about making them all crash the app.

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

1 participant