Fix hanging processes when warc download fails#5
Merged
rfbr merged 3 commits intokyutai-labs:mainfrom Oct 14, 2025
Merged
Conversation
6898c41 to
fbe31fe
Compare
fbe31fe to
2c7a0b5
Compare
gabrieldemarmiesse
requested changes
Oct 14, 2025
| class WarcResults: | ||
| warc_url: str | ||
| success: bool | ||
| total_records: int |
Collaborator
There was a problem hiding this comment.
Can this be an attribute computed dynamically to avoid asking the caller to keep track of it?
Something like
@property
def total_records():
return self.processed_records + self.failed_records| processed_records=processed_records, | ||
| failed_records=failed_records, | ||
| ) | ||
| except Exception: |
Collaborator
There was a problem hiding this comment.
Here we never print the exception, it can be a pain to debug then. Can we put it in WarcResults? If it's not pickable we can always store the error message there.
Collaborator
Author
There was a problem hiding this comment.
As it was mainly RequestException or IncompleteRead errors I thought it wasn't really needed. Nevertheless it makes more sense to log the error. Done!
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.
Previously when a
RequestExceptionoccurred while getting a WARC url, the sub-process running thedocument_generatorfunction would crash without yielding any result.The following logic
would thus never reach the expected count, preventing the loop from breaking, causing the main process to hang indefinitely.
This commit fixes the issue by:
get_responsecall in a try-except to catchRequestException, yielding a WarcResults with success=False in case of a RequestExceptionIt also improve the error reporting with some statistics about failed WARC and records.