Description
Description
All MongoDB operations in storage.py and database.py should be retried, possibly indefinitely. Right now a closed connection will result in a pymongo.errors.ConnectionFailure exception that's passed to the caller. If running storage.py standalone any exception in insert_to_db will be caught by eiffel-pythonlib and possibly retried later a limited number of times (I don't recall the exact behavior), but we should never give up. Same thing when obtaining a database connection; just retry until we get a connection (but log all failures).
Motivation
Connection failures are inevitable and we should deal with them gracefully.
Benefits
A more reliable service that won't require manual input after outages.
Possible Drawbacks
More error handling and retries complicates the code and could make it harder to write tests.