Skip to content

Raise zip entry cap to 8 GiB, configurable via env - #3

Merged
MiniCodeMonkey merged 1 commit into
masterfrom
fix/zip-entry-limit
Oct 5, 2026
Merged

MiniCodeMonkey merged 1 commit into
masterfrom
fix/zip-entry-limit

Conversation

@MiniCodeMonkey

Copy link
Copy Markdown
Member

Problem

au/vic/statewide parcels (3.2 GB zip) contains VMPROP.gdb/a00000014.gdbtable, which declares 2,540,059,567 bytes. The zip-bomb guard from c90ee0e (MAX_ZIP_ENTRY_BYTES = 2 GiB) rejects it, so the source has failed in RunBatchMachineParcels since 2026-08-28.

Change

  • Per-entry declared-size cap default raised from 2 GiB to 8 GiB.
  • New env var BATCH_MACHINE_MAX_ZIP_ENTRY_BYTES (integer bytes) overrides it, read on each extraction.
  • The guard has no compression-ratio check and no total-size cap, only the per-entry cap and nested-zip depth (10), so nothing else needed changing. A 3.2 GB archive is not blocked by anything else.

Disk space

Extraction goes to <workdir>/Unzipped/ (ZipDecompressTask.decompress), where workdir is an mkdtemp(prefix='conform-', dir=destdir) directory in openaddr/__init__.py. The cached zip is also copied into that workdir, so a job needs roughly the archive size plus the full extracted size on that volume. There is no free-space check anywhere in the repo, so an exhausted disk fails mid-extraction. The 8 GiB cap bounds a single entry only, not the sum of entries. Worker temp space for this source should be at least ~10 GB; I did not add a disk check.

Tests

Added to TestZipDecompressTask: entry under the cap extracts, default is 8 GiB and admits the 2.54 GB entry, env override refuses an oversized entry, env override raises a lowered cap. Existing oversized-entry test still passes. python3 -m unittest openaddr.tests.conform.TestZipDecompressTask (10 tests OK) and python3 test.py (128 tests OK) run in the Docker image. Note test.py does not import TestZipDecompressTask, so CI does not run these tests today.

After merging

The amd64 image must be rebuilt and pushed (registry.geocod.io/geocodio/batch-machine:latest), and the workers must docker pull it. The registry proxy caches :latest, so a manual pull is needed for workers to see the new image.

https://claude.ai/code/session_01VHQ8tPQxvwtMYJfu4EGeos

au/vic/statewide ships a 3.2 GB parcels zip whose VMPROP.gdb/a00000014.gdbtable
declares 2,540,059,567 bytes, over the 2 GiB per-entry cap, so the source
failed. The cap now defaults to 8 GiB and BATCH_MACHINE_MAX_ZIP_ENTRY_BYTES
overrides it.

Claude-Session: https://claude.ai/code/session_01VHQ8tPQxvwtMYJfu4EGeos
@MiniCodeMonkey
MiniCodeMonkey merged commit 5a76854 into master Oct 5, 2026
1 check 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.

1 participant