ceros/ShareJS — pull request #13 by MattSurabian (2013-12-16 21:30:15+00:00)
Title: Sharejs daemon

When ShareJS throws an uncaught exception the process is considered to be in a brittle and dirty state, best practice is to exit the process and relaunch it. [ShareJS is now being monitored by upstart](https://github.com/ceros/ceros-product-chef/pull/13) which handles the keep alive logic. All our process needs to do is exit when it reaches an unstable state and prevent further resource leaking.

*This branch is rigged to potentially trigger an uncaught exception event on the sharejs process 1 out of 11 times.*

## Testing Notes

- Ensure that when a ShareJS error occurs (keep refreshing until you see the infinite spinner) ShareJS is properly restarted. Confirm that on refresh (or a few as it's possible to hit multiple failures in a row) sharejs eventually reconnects without a manual restart of ShareJS.
- Confirm that above failures and restarts show up on the sharejs_alive graph in RightScale. The graph data may be delayed by up to a minute but everything should show up.
- Confirm that other users connected in the studio are not affected, or that this disruption is edge case enough to be non problematic.