Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openaddr/conform.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ class ZipDecompressTask(DecompressionTask):
# any per-entry file type filtering applies. Cap the declared
# (uncompressed) size of any single entry and how many nested zips deep
# we'll recurse, so worst case is bounded and the job fails loudly
# instead of exhausting disk. The per-entry cap defaults to 8GiB and can
# instead of exhausting disk. The per-entry cap defaults to 16GiB and can
# be overridden with the BATCH_MACHINE_MAX_ZIP_ENTRY_BYTES env var.
MAX_ZIP_ENTRY_BYTES = 8 * 1024 ** 3 # 8GiB
MAX_ZIP_ENTRY_BYTES = 16 * 1024 ** 3 # 16GiB
MAX_NESTED_ZIP_DEPTH = 10

def _max_entry_bytes(self):
Expand Down
5 changes: 3 additions & 2 deletions openaddr/tests/conform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2937,9 +2937,10 @@ def test_entry_under_limit_extracts(self):

self.assertIn('readme.txt', {os.path.basename(path) for path in output_files})

def test_default_entry_limit_admits_entries_over_two_gib(self):
self.assertEqual(ZipDecompressTask.MAX_ZIP_ENTRY_BYTES, 8 * 1024 ** 3)
def test_default_entry_limit_admits_large_known_entries(self):
self.assertEqual(ZipDecompressTask.MAX_ZIP_ENTRY_BYTES, 16 * 1024 ** 3)
self.assertGreater(ZipDecompressTask.MAX_ZIP_ENTRY_BYTES, 2540059567)
self.assertGreater(ZipDecompressTask.MAX_ZIP_ENTRY_BYTES, 9043535569)

def test_entry_limit_env_override_refuses_oversized_entry(self):
outer_zip_path = self._make_outer_zip()
Expand Down
Loading