Skip to content

fix(chart): fit FULL pages into the memory limit - #420

Merged
uniqueg merged 1 commit into
devfrom
fix/chart-full-page
Nov 4, 2026
Merged

uniqueg merged 1 commit into
devfrom
fix/chart-full-page

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Closes #414

Summary

Serving a page of the view FULL holds 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).

  • The chart sets 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.
  • Figures corrected in docs/configuration.md, pro_tes/config.yaml and the values' comments; note in deployment/README.md and docs/upgrading.md.
  • The commented example of custom moved under the live block, so that uncommenting it doesn't replace the default.

Verification

  • python -m pytest with real Helm: all passed. pre-commit run --from-ref origin/dev --to-ref HEAD: passed.
  • Chart and Smoke test run 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

  • A page bounded by bytes instead of tasks, as text that JSON escapes can take up to 6 times its size: a larger change; documented, and left for later.
  • Checks at render time for 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:

  • Reduce the Helm chart's default FULL task-page size so requests fit within the deployment memory limit.

Enhancements:

  • Document FULL-page memory usage, sizing guidance, chart defaults, and upgrade behavior.
  • Preserve and validate the chart's default custom configuration while keeping user-provided custom settings mergeable.

Deployment:

  • Set the chart default for config.custom.controllers.list_tasks.max_page_size_full to 6 and explain how to increase it alongside the memory limit.

Documentation:

  • Update configuration, deployment, and upgrade documentation with revised FULL-page memory estimates and migration guidance.

Tests:

  • Update chart tests to verify the default FULL-page limit and custom configuration behavior.

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 uniqueg added this to the v0.5.0 milestone Nov 4, 2026
@uniqueg
uniqueg marked this pull request as ready for review November 4, 2026 06:29
@sourcery-ai

sourcery-ai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The 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 page

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Set a safer Helm default for FULL task pages and preserve that default when custom configuration is merged.
  • Limit FULL pages to six tasks in the chart’s live custom configuration.
  • Move the custom configuration example below the live default so uncommenting examples does not replace the default.
  • Update chart tests for default values, section nulling, and custom configuration merges.
deployment/values.yaml
tests/test_chart.py
Document the memory model and configuration tradeoffs for FULL task pages.
  • Explain the approximately threefold per-request memory overhead, worker concurrency, log-size effects, and chart-specific estimates.
  • Update application comments and deployment guidance to pair page-size changes with the memory limit.
  • Describe the chart upgrade behavior, smaller-page pagination, and reuse-values/null caveats.
deployment/README.md
docs/configuration.md
docs/upgrading.md
pro_tes/config.yaml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35634386 | 📁 Comparing 0e259b3 against latest (427021f)

  🔍 Preview build  

3 files changed
± configuration/index.html
± deployment/index.html
± upgrading/index.html

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread deployment/values.yaml Resolved
Comment thread docs/configuration.md Resolved
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (427021f) to head (0e259b3).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg merged commit 2ef3770 into dev Nov 4, 2026
40 of 44 checks passed
@uniqueg
uniqueg deleted the fix/chart-full-page branch November 4, 2026 06:37
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]>
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.

fix(chart): page of view FULL over memory limit

1 participant