Skip to content

fix(service): bound Service session answers and export queue - #4140

Open
dan-petty wants to merge 4 commits into
mainfrom
fix/4116-service-memory-growth
Open

dan-petty wants to merge 4 commits into
mainfrom
fix/4116-service-memory-growth

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The roadmap Service held up to 64 GitHub answers with no limit on bytes, and the OTel export queue had no limit. A 200 round test showed the answer store growing 56 MiB. The store now has a 64 MiB byte budget and skips an answer larger than the budget. The export queue holds at most 256 payloads and counts each dropped payload. The new alert RoadmapServiceMemoryNearLimit fires at 85 percent of the memory limit for 10 minutes. The memory limit is unchanged.

Closes #4116

Change: openspec/changes/archive/2026-11-08-4116-roadmap-service-is-oomkilled-after/
Elapsed: 3.60s

@dan-petty dan-petty added type/bug Defect, regression, or incorrect runtime behavior scope/service The long-running devops Service and its lanes labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record for #4116.

Fail-to-pass run (devops ci fail-to-pass --base origin/main): 8 tests fail on base and pass on this branch, 0 error. They are:

  • tests/server/test_service_memory.py: over 200 rounds with fakes, the heap grew 56.1 MiB between round 10 and round 200 on base. The largest allocation site was gidgethub/sansio.py:64 (64 stored answers, 64 MB).
  • tests/telemetry/test_export_queue.py: on base, a collector that does not answer takes 1000 payloads and no drop is counted.
  • tests/github/test_github_session.py: the byte budget and the answer larger than the budget.
  • Alert tests in tests/prometheus/test_k8s_monitoring_alerting.py and the promtool case in tests/fixtures/prometheus_rules/roadmap_service_tests.yaml for RoadmapServiceMemoryNearLimit.

Full devops ci on the final code, before the rebase onto origin/main: exit 0, all 25 rows pass, 11 min 50 s. The Tests row (11 min 36 s) is over the 5 minute budget (known class: #3593). The slowest test is the unchanged roadmap-service-activity promtool case. The new 200 round test takes 32 to 50 s. After the rebase (3 commits, no conflict) 83 narrow tests pass and devops docs generate --check is clean.

Scope and rollout:

  • No setting and no ConfigMap key is added, removed, renamed or tightened. The byte budget (64 MiB) and the queue cap (256 payloads) are constants in config/defaults.py.
  • No MALLOC_ARENA_MAX. The arena measure showed no fragmentation (RSS flat).
  • The memory limit is unchanged.

Not verified: the store plateaus at 64 answers, about 80 MB for real issue pages. That alone may not explain growth from 370 MiB to 860 MiB. The 6 hour flat check (#4125) stays with a person. The alert shows whether the growth continues.

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 05:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/service The long-running devops Service and its lanes type/bug Defect, regression, or incorrect runtime behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(service): roadmap-service is OOMKilled after hours

1 participant