Skip to content

Comments

Validate RECORD file using streams instead of reading in-memory#186

Merged
pradyunsg merged 3 commits intopypa:mainfrom
pradyunsg:validate-stream
May 29, 2023
Merged

Validate RECORD file using streams instead of reading in-memory#186
pradyunsg merged 3 commits intopypa:mainfrom
pradyunsg:validate-stream

Conversation

@pradyunsg
Copy link
Member

Supercedes and closes #183
Fixes #185

This ensures that the validation can be performed without loading the entire file in-memory.

pradyunsg added 2 commits May 29, 2023 20:37
This ensures that the validation can be performed without loading a
file in-memory.
This ensures that the hashing logic within the codebase does not attempt
to read large files into memory, which can cause OOM issues.
@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior component: records Related to installer.records component: sources Related to WheelSource and friends labels May 29, 2023
This function is no longer meant to be used, since there's a superior
alternative available.
@pradyunsg pradyunsg merged commit 5f281b8 into pypa:main May 29, 2023
@pradyunsg pradyunsg deleted the validate-stream branch May 29, 2023 20:10
@ralbertazzi
Copy link

Thank you @pradyunsg , your solution is cleaner :)

Another optimization that we can bring is performing hash validation just once, as we currently perform it during 1. wheel validation 2. wheel installation. I tried hacking it away in python-poetry/poetry#8027 but it would be clearly better to see this natively supported by installer. I first want to get a better understanding at the performance benefit and, if any, I will open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: records Related to installer.records component: sources Related to WheelSource and friends type: bug A confirmed bug or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RECORD file validation loads the entire file in memory

2 participants