Open emanuil-tolev opened 8 years ago
requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.ebi.ac.uk', port=80): Max retries exceeded with url: /europepmc/webservices/rest/search/query=ISSN:%221935-2735%22%20OPEN_ACCESS:%22y%22%20UPDATE_DATE:2006-10-31%20sort_date:%22y%22&resulttype=core&format=json&page=1&pageSize=1000 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff6de042090>: Failed to establish a new connection: [Errno -2] Name or service not known',))
EPMC doesn't seem to exist in this case - obviously a temporary problem. Best to catch requests.exceptions.ConnectionError, sleep for 10s, and retry - up until a few hours of trying. Log each retry.
This should already be using the re-try code in octopus, so it evidently was failing for a while.
What we should do is tweak the retry settings for the app - raise the max wait time, and the number of retry attempts so that any service blips are dealt with.
You could override any of these in the local.cfg, or I can update them in config/service.py
Should catch exceptions maybe?