Skip to content

Add retry for HTTP status 502 #590

Merged
ghukill merged 2 commits into
mainfrom
hotfix-add-retry-status-code
May 26, 2026
Merged

Add retry for HTTP status 502 #590
ghukill merged 2 commits into
mainfrom
hotfix-add-retry-status-code

Conversation

@ghukill

@ghukill ghukill commented May 26, 2026

Copy link
Copy Markdown
Contributor

Purpose and background context

Add 502 as a status code to retry on. New DSpace CRIS instance (and likely GLAM) will intermittently throw 502's under load, but react well to retries.

How can a reviewer manually see the effects of these changes?

Very difficult to recreate! Failures have been intermittent for DSpace CRIS harvesting, particularly for long running ones. With this change, not seeing any failed harvests (at least not yet, at which time we may need to add more codes).

Includes new or updated dependencies?

YES: took opportunity to update dependencies

Changes expectations for external applications?

NO

What are the relevant tickets?

  • None

Code review

  • Code review best practices are documented
    here
    and you are encouraged to have a constructive dialogue with your reviewers
    about their preferences and expectations.

@ghukill ghukill requested a review from a team as a code owner May 26, 2026 19:51
@ghukill ghukill changed the title Hotfix add retry status code Add retry for HTTP status 502 May 26, 2026
Comment thread harvester/config.py
OPTIONAL_ENV_VARS = ("RECORD_SKIP_LIST", "SENTRY_DSN", "STATUS_UPDATE_INTERVAL")
REQUIRED_ENV_VARS: tuple = ()
OPTIONAL_ENV_VARS: tuple = (
"WORKSPACE",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also removed WORKSPACE as a required env var, which is something we've slowly started adopting in newer projects. FWIW, this env var is set in AWS for the OAI harvester, so the effect is only a nice-to-have for local dev work.

@ghukill ghukill merged commit 174237c into main May 26, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants