Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed change addresses the stated OOM risk with no unresolved blocking issues.
Review effort: Lite
Findings: None
What changed in this PR
This pull request bounds Git repack resource usage for large AOSP repositories to prevent container OOM failures.
Changes:
- Limits repack parallelism to four threads.
- Caps window and delta cache memory at 256 MiB each.
| File | Description |
|---|---|
aosp.sh |
Applies bounded Git repack settings during bitmap generation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
0fdf4fc to
24f21d5
Compare
|
Updated: the threads/memory caps are now configurable via |
pack.threads defaults to the host CPU count and pack.windowMemory is
unbounded; on large repos 'git repack -a -b -d' can then get SIGKILLed
by the container memory limit ('pack-objects died of signal 9' during
the bitmap-index step).
Cap both per thread via TUNASYNC_AOSP_PACK_THREADS (default 4) and
TUNASYNC_AOSP_PACK_WINDOW_MEMORY (default 256m) so sites can tune for
their own container limit. pack.deltaCacheSize needs no cap here since
git already defaults it to 256m.
24f21d5 to
990c18b
Compare
|
Follow-up data point from production (NJU): with this patch applied, the repack no longer dies within minutes, but a job-wide memory cap still matters. Repacking the largest AOSP repos (100GB+ class, tens of millions of objects) pushed git's anonymous RSS to ~8.2GB (total-vm 130GB) even with So the practical recipe for sites with huge repos is: this patch (sane defaults + env overrides) plus a larger container memory limit for the aosp job (we now run it with 32G; host RAM is cheap compared to a 2-day retry loop). Defaults of 4 threads / 256m are still the right conservative choice for arbitrary deployments. |
pack.threadsdefaults to the host CPU count andpack.windowMemoryis unbounded; on a many-core worker running the job in a memory-limited container,git repack -a -b -don large AOSP repos gets SIGKILLed during the bitmap-index step (error: pack-objects died of signal 9), failing the whole job afterrepo syncsucceeded.Cap both per thread, configurable via env since container limits and CPU counts differ per site:
TUNASYNC_AOSP_PACK_THREADS(default4)TUNASYNC_AOSP_PACK_WINDOW_MEMORY(default256m)pack.deltaCacheSizeneeds no explicit cap — git already defaults it to 256m. (Git's ownGIT_CONFIG_COUNT/GIT_CONFIG_KEY_nenv injection was considered, but command-line-ctakes precedence over it and the repo convention isTUNASYNC_*variables.) Seen in production on a 64-core worker with an 8G container limit.