fix(admin): bound request log export memory - #5089
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of commit Files Reviewed (2 files)
Previous Review Summaries (3 snapshots, latest commit 14b548e)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 14b548e)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of commit Files Reviewed (2 files)
Previous review (commit a421e84)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of the follow-up commit Files Reviewed (2 files)
Previous review (commit fca109a)Status: No Issues Found | Recommendation: Merge Executive SummaryReviewed the request-log ZIP finalization fix (ceiling-bounded pagination, per-batch Archiver backpressure via entry counting, level-1 compression, raised 800s budget) and its database-backed regression test; the stream-coordination logic is race-free, the pagination bound deterministically excludes concurrent inserts, and the test correctly verifies a complete, extractable ZIP across a backpressured page boundary. Files Reviewed (2 files)
Reviewed by kimi-k3 · Input: 54.8K · Output: 12.6K · Cached: 350.2K Review guidance: REVIEW.md from base branch |
Root Cause
The captured failed download confirms an out-of-memory termination. The 22.8 MB partial ZIP contains 818 local entry headers but only 817 completed data descriptors and no central directory or end-of-central-directory record. Its completed entries represent about 436 MB of uncompressed request-log data.
The previous
readableLengthcheck only observed Archiver's output buffer. It did not observe Archiver's internal input queue, so database pages accumulated faster than compression could process them.Summary
The branch includes the latest
main. Timeout, compression-level, pagination-ceiling, and concurrent-insert changes are not part of this PR diff.Verification
pnpm --filter web exec jest --runInBand src/app/admin/api/api-request-log/download/route.test.tspnpm --filter web typecheckpnpm --filter web lintpnpm formatgit diff --check origin/main...HEADVisual Changes
None. Admin download endpoint only.