Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle two exceptions causing sync_patron_activity job to fail (PP-1838) #2132

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Oct 23, 2024

Description

Handle PatronAuthorizationFailedException and RemoteIntegrationException so they do not cause the sync_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:

Task Name Exception Count
patron_activity.sync_patron_activity PatronAuthorizationFailedException 1719
patron_activity.sync_patron_activity RemoteIntegrationException 231

Since these errors are mostly unavoidable, we don't want the job to fail because of them.

How Has This Been Tested?

  • Tests running in CI

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@jonathangreen jonathangreen requested a review from a team October 23, 2024 15:27
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base (371492c) to head (110ff4e).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2132   +/-   ##
=======================================
  Coverage   90.82%   90.82%           
=======================================
  Files         352      352           
  Lines       40854    40872   +18     
  Branches     8852     8854    +2     
=======================================
+ Hits        37104    37122   +18     
  Misses       2442     2442           
  Partials     1308     1308           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathangreen jonathangreen added the bug Something isn't working label Oct 23, 2024
Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! ✅

@jonathangreen jonathangreen merged commit 4043a57 into main Oct 23, 2024
20 checks passed
@jonathangreen jonathangreen deleted the bugfix/patron-sync-failures branch October 23, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants