Add backoff
to Stocksnap DAG for 5XX errors
#4878
Labels
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
good first issue
New-contributor friendly
help wanted
Open to participation from the community
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: catalog
Related to the catalog and Airflow DAGs
🔧 tech: airflow
Involves Apache Airflow
🐍 tech: python
Involves Python
Airflow log link
https://airflow.openverse.org/dags/stocksnap_workflow/grid?dag_run_id=manual__2024-09-05T18%3A39%3A42%2B00%3A00&task_id=ingest_data.pull_image_data&base_date=2024-09-05T18%3A39%3A42%2B0000&tab=logs
Description
It looks like we're starting to encounter ephemeral 5XX errors with certain Stocksnap errors (separate from #4101). We should add a
backoff.on_exception
wrapper to the_get_filesize
function of the ingestion class so these errors can be retried:openverse/catalog/dags/providers/provider_api_scripts/stocksnap.py
Line 160 in 7f4fb7c
This can be done using a decorator like Freesound:
openverse/catalog/dags/providers/provider_api_scripts/freesound.py
Line 182 in 05f8c55
Although we'd want the check to look like the global one for Science Museum (see #4715)
openverse/catalog/dags/providers/provider_api_scripts/science_museum.py
Lines 50 to 59 in 81d8da8
Reproduction
Since these are temporal issues, I wasn't able to reproduce the 502 in the logs
DAG status
I've left this enabled, though I will add a silenced alert clause for this linking to this issue.
The text was updated successfully, but these errors were encountered: