untoldone / bloomapi

Create APIs out of public datasources
https://www.bloomapi.com/documentation/public-data
MIT License
89 stars 29 forks source link

Harden BloomAPI to unexpected exceptions #40

Closed untoldone closed 9 years ago

untoldone commented 10 years ago

Currently there's no protection from unexpected exceptions in the production environment, we should either do a better job capturing/ logging them or do a better job of running many threads/ processes that when crashing will gracefully restart without hurting other users.

Proposed handing of issues: 1) 500 error when possible without impacting other connections on same thread 2) when issue does cause crash, try to gracefully complete existing other connections before restarting thread 3) log errors even when thread crashes (today exception is lost)

See http://www.asyncdev.net/2013/07/promises-errors-and-express-js/ for more details on how nodejs behaves with exceptions in callbacks (main issue currently) and for potential solutions using domains in nodejs

untoldone commented 9 years ago

Fixed with latest deploy -- now live in prod