-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cortex: Add error handling and retry
Add error handling for Cortex API. Adopt retrying based on a requests session retry adapter analogous to the Cuckoo module. With this change we correctly handle inavailability of the Cortex API at startup, during submit and when tracking job status. At startup and submit we give up after a number of retries with increasing backoff and return an error. When tracking jobs the same happens but the error is ignored and job status retrieval retried on the next iteration because we have no alternative than to try to limp on. If unavailability continues, the job will eventually run into the maximum_job_age timeout and be reported as failed to the client (if they're even still interested in it and haven't dropped the connection already). Requires a current cortex4py module that allows to supply a custom session object - see https://github.com/michaelweiser/Cortex4py/tree/session for now.
- Loading branch information
1 parent
46ce5aa
commit 8964236
Showing
1 changed file
with
95 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters