Repository navigation
fix(chart): fit FULL pages into the memory limit - #420
Merged
Merged
Conversation
A page of the view FULL holds about 3 times its size in memory, per request, and the chart's default of 64 tasks of up to 2 MiB exceeds its memory limit of 256 MiB. Set max_page_size_full to 6 in the chart, and correct the figures in docs and comments. Closes #414 Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg
marked this pull request as ready for review
November 4, 2026 06:29
Reviewer's GuideThe chart now defaults FULL task pages to six tasks so concurrent serialization stays within the 256 MiB deployment limit, while configuration merging and tests preserve that default and documentation explains the memory calculations, tuning guidance, and upgrade behavior. Sequence diagram for serving a bounded FULL task pagesequenceDiagram
participant Client
participant Chart as HelmChart
participant API as TaskAPI
participant Worker as GunicornWorker
Chart->>API: Configure max_page_size_full=6
Client->>API: GET /tasks?view=FULL
API->>API: Limit page to max_page_size_full
API->>Worker: Serialize FULL task page
Worker-->>Client: Page with up to 6 tasks
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="deployment/values.yaml" line_range="46" />
<code_context>
+ custom:
+ controllers:
+ list_tasks:
+ max_page_size_full: 6
+ # Examples:
+ # tes:
</code_context>
<issue_to_address>
**FULL requests exceed the memory limit**
When four concurrent FULL requests serve six tasks with logs rich in characters that JSON escapes, `max_page_size_full` limits task count, not serialized bytes, so JSON escaping makes the pages exceed the documented memory estimate and can push the app past 256 MiB, OOM-killing the pod and failing requests.
Bound FULL pages by serialized size or budget for worst-case JSON-escaping expansion.
Also at `deployment/values.yaml:314-315`, `docs/configuration.md:443-445`.
</issue_to_address>
### Comment 2
<location path="docs/configuration.md" line_range="436" />
<code_context>
- it serves at once). For small memory limits (e.g., the 256 MiB of the
- [Helm chart](deployment.md)), lower `max_page_size_full` (e.g., to 8) or
- raise the memory, if users may store large tasks.
+ limit](#request-size-limit) (1 MiB by default), plus its logs
+ (`post_task.max_log_size`, 1 MiB by default), so a page of the view `FULL`
+ may be about `max_page_size_full` times that size (128 MiB with the app's
</code_context>
<issue_to_address>
**Output records bypass the page estimate**
When a backend reports many or large output-file records in task logs that still fit in a MongoDB document, `_limit_logs` caps only text, not the output-file records in backend logs; `_store_within_limit` retains those records whenever the MongoDB document fits. A page can therefore contain much more than the estimated 2 MiB per task, and concurrent FULL requests can exceed the chart's memory limit.
Bound the size or count of logged output-file records, or include them in a byte-based FULL-page memory limit.
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: deployment/values.yaml:46, docs/configuration.md:436
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #420 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 2642 2642
=========================================
Hits 2642 2642 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
added a commit
that referenced
this pull request
Nov 4, 2026
Brings in the review fixes #410, #412, #417, #419, #420, #421. The only conflict is in the module docstring of `pro_tes/ga4gh/tes/backends.py`: keeps this branch's removal of the FOCA 0.19 caveat about redirects, and the sentence of #419 about tasks in the view `FULL`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #414
Summary
Serving a page of the view
FULLholds about 3 times its size in memory, per request, and the chart's 256 MiB didn't hold pages of the app's default 64 tasks of up to 2 MiB (with logs).config.custom.controllers.list_tasks.max_page_size_full: 6: about 36 MiB per request, 144 MiB with its 4 threads, on top of about 90 MiB of the app.docs/configuration.md,pro_tes/config.yamland the values' comments; note indeployment/README.mdanddocs/upgrading.md.custommoved under the live block, so that uncommenting it doesn't replace the default.Verification
python -m pytestwith real Helm: all passed.pre-commit run --from-ref origin/dev --to-ref HEAD: passed.ChartandSmoke testrun in CI. Not measured: memory of a live deployment; the figures come from the review of 0.5.0 and a script modelling the serialisation.Declined review findings
config.custom: null: not warranted; the upgrade notes mention it, and--reuse-values.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Set a memory-safe default for FULL task pages in the Helm chart and document the corresponding resource and upgrade guidance.
Bug Fixes:
Enhancements:
Deployment:
config.custom.controllers.list_tasks.max_page_size_fullto 6 and explain how to increase it alongside the memory limit.Documentation:
Tests: