feat: throw error on partial downloads - #21
Conversation
|
This is an improvement -- I had no idea fsspec would just return EOF -- but can we also set the retry strategy for fsspec while we're at it? Looks like we can install aiohttp-retry and then use it like this: If instead you are using s3 then there's a similar boto3 config. @lfoppiano can you please have a look? I think our recent |
|
Oh @mfroach I probably should have started by asking you what WARC you were reading -- https or s3, our bucket or someone elses, etc etc. |
I only wrote this to catch HTTP failures. As far as I can tell, s3fs handles this case with automatic retry or throws an exception. |
|
I've added some changes which integrate Greg's suggestion, is it OK if I push them directly on your fork, @mfroach and you can double check it? (you should make sure that "maintainer can modify/write" is enabled for your PR). (Suggestion) For the (hopefully) next PR, perhaps you should create a branch on your fork. |
|
@lfoppiano please go ahead and push, yes! I will take a look. Sorry I forgot to create a new branch! |
|
@mfroach pushed. Thank you! |
|
Awesome. This looks much more robust. The added test is particularly good. Thanks @lfoppiano! |
If we receive a partial download due to network cutoff or truncation, with all valid records, no warning is thrown about records skipped and the user has no way of knowing the data is incomplete. Added a check for matching reported size and received size of dataset.