Skip to content

Validate HTTP Range responses in subset downloads - #521

Merged
blaylockbk merged 3 commits into
blaylockbk:mainfrom
jacob1299:fix/subset-range-validation
Apr 10, 2026
Merged

Validate HTTP Range responses in subset downloads#521
blaylockbk merged 3 commits into
blaylockbk:mainfrom
jacob1299:fix/subset-range-validation

Conversation

@jacob1299

@jacob1299 jacob1299 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Subset downloads now check for HTTP 206 before reading the response body
  • Uses stream=True so multi-GB responses are never downloaded into memory on failure
  • Raises RuntimeError if Range requests are not honored

Ref #514

Test plan

  • New test: test_subset_range_validation.py validates RuntimeError on non-206
  • Existing subset tests pass (real S3 returns 206, guard is a no-op)
  • Existing RRFS template tests pass

@jacob1299
jacob1299 marked this pull request as ready for review April 1, 2026 22:35
@jllmoe

jllmoe commented Apr 2, 2026

Copy link
Copy Markdown

Thx again jacob1299!

I am very happy to inform you that I have resolved the issue by sync'ing the installed python packages on my laptop to those installed on my Desktop, now the variable-subset downloading is working as expected on my laptop as well.

Thank you so much again for your help and developing the Herbie package and I apologize for the "false alarm" in this specific regard (i.e. not working on my laptop but working on my desktop.).

The current variable-subset downloading in your Herbie package will definitely significant improve my project's efficiency, it would be even better if it can do spatial subset downloading simultaneously (along with variable-subset).

Have a great day!
John

@blaylockbk

Copy link
Copy Markdown
Owner

Nice fix. I can see the need for this check. I'll try to get this merged when I have a chance to test it myself.

@jacob1299

Copy link
Copy Markdown
Contributor Author

Thx again jacob1299!

I am very happy to inform you that I have resolved the issue by sync'ing the installed python packages on my laptop to those installed on my Desktop, now the variable-subset downloading is working as expected on my laptop as well.

Thank you so much again for your help and developing the Herbie package and I apologize for the "false alarm" in this specific regard (i.e. not working on my laptop but working on my desktop.).

The current variable-subset downloading in your Herbie package will definitely significant improve my project's efficiency, it would be even better if it can do spatial subset downloading simultaneously (along with variable-subset).

Have a great day! John

Glad to hear it's working as expected, and you're very welcome!

@blaylockbk
blaylockbk merged commit be7533f into blaylockbk:main Apr 10, 2026
12 of 19 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.

3 participants