pa11y-webservice icon indicating copy to clipboard operation
pa11y-webservice copied to clipboard

"Topology was destroyed" error after returning from sleep

Open josebolos opened this issue 4 years ago • 0 comments

Yesterday I was running pa11y-dashboard locally for debugging purposes, put the laptop to sleep with the dashboard still running, and today after I tried to use the dashboard I started getting the following errors:

  1. Topology was destroyed: When trying, for example, to edit the details of a task (http://localhost:4000/5d33aae9c193490149107fa3/edit) the page will render correctly but Topology was destroyed will appear in the logs. Any attempt to access the DB will show this error. The app is unable to connect to the DB at all, which means that is in an unsafe/invalid state.
  2. When in that state, trying to browse some of the pages (e.g. the home page) will generate an HTTP 500 error, but not all of them will.

We should probably catch these errors and make the app either re-attempt to connect to the DB, or bail out and crash, so any process management (e.g. pm2, forever, etc) can re-launch the app.

It may seem unlikely that users ever see this message but there's a chance this could happen if a running instance gets temporarily suspended (doesn't Heroku do something like this?) but, regardless, because it's good behaviour to catch these errors and try to recover or exit cleanly instead of being stuck in a permanent "HTTP 500" state.

josebolos avatar Sep 20 '19 09:09 josebolos