Add catalist match download retry logic#1853
Open
sharinetmc wants to merge 2 commits into
Open
Conversation
Contributor
IanRFerguson
left a comment
There was a problem hiding this comment.
I have a code question and a context question
in terms of the code, it feels like we could wrap the function with @backoff.expo and achieve a similar outcome
in terms of context, this seems fine I'm just wondering if we have reason to believe that a retry is going to solve this Catalist issue. probably can't hurt I just want to understand the intent here
Comment on lines
+342
to
+357
| def fetch_zip_with_retry( | ||
| self, remote_path: str, job_id: str, max_retries: int = 3, backoff_factor: int = 2 | ||
| ): | ||
| last_exception = None | ||
|
|
||
| for attempt in range(1, max_retries + 1): | ||
| try: | ||
| # 1. Attempt the download | ||
| temp_file_zip = self.sftp.get_file( | ||
| remote_path=remote_path, export_chunk_size=DEFAULT_EXPORT_CHUNK_SIZE | ||
| ) | ||
|
|
||
| # 2. Validate the integrity of the file | ||
| if not is_zipfile(temp_file_zip): | ||
| size = temp_file_zip.stat().st_size | ||
| raise RuntimeError(f"Corrupt zip (Size: {size} bytes)") |
Contributor
There was a problem hiding this comment.
curious why we don't just decorate this function with @backfoff, the retry logic feels kind of manual
bmos
reviewed
Apr 28, 2026
Comment on lines
+350
to
+352
| temp_file_zip = self.sftp.get_file( | ||
| remote_path=remote_path, export_chunk_size=DEFAULT_EXPORT_CHUNK_SIZE | ||
| ) |
Collaborator
There was a problem hiding this comment.
This will solve your test failure
Suggested change
| temp_file_zip = self.sftp.get_file( | |
| remote_path=remote_path, export_chunk_size=DEFAULT_EXPORT_CHUNK_SIZE | |
| ) | |
| temp_file_zip = Path( | |
| self.sftp.get_file( | |
| remote_path=remote_path, | |
| export_chunk_size=DEFAULT_EXPORT_CHUNK_SIZE | |
| ) | |
| ) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this change?
Considerations for discussion
How to test the changes (if needed)
Breaking Changes
Breaking changes are changes to our public API which may require existing users to change their code. If there are no breaking changes, any existing parsons user should not need to do anything after updating their parsons version.
Does this PR introduce breaking changes?
Details (if needed)