Handle two exceptions causing sync_patron_activity job to fail (PP-1838) #2132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Handle
PatronAuthorizationFailedException
andRemoteIntegrationException
so they do not cause thesync_patron_activity
job to fail.The
PatronAuthorizationFailedException
that we are getting come mostly from the Enki collection. This appears to happen when the patron doesn't have any loans for Enki items.The
RemoteIntegrationException
errors that we are seeing are mostly 504 responses coming back from Overdrive. These responses tend to come in waves, so I think it makes sense to do a few retries to see if we can successfully perform a sync.Motivation and Context
When looking at setting up alerting for failing celery tasks, I saw that a large number of tasks were failing. In the last week I saw these failures:
Since these errors are mostly unavoidable, we don't want the job to fail because of them.
How Has This Been Tested?
Checklist