Skip to content

test(service): Verify Service working set stays flat for six hours #4125

Open

Description

@devops-cli-service

Split from #4116.

The change bounds the session's stored answers, bounds the export queue and sets MALLOC_ARENA_MAX=2. Only a pod that runs for hours shows whether the working set stays flat and whether the glibc arenas were the cause. Why this part is deferred: it needs the merged image, a rollout, six hours of run and a read of the process maps in the pod. No offline test and no pull request settles it. Acceptance criteria: a pod of the merged image runs 6 hours and does not restart; container_memory_working_set_bytes of container service stays within 100 MiB of its value at the first hour, read in Grafana; the heap mappings of the process do not grow after the first hour, read from /proc/1/smaps; the pull request comments the Grafana panel and the map summary.

Proposed design

Problem statement

The Service working set grew 100 to 150 MiB each hour before the kernel killed the container (#4116). #4116 bounds the stored answers and the export queue. The Deployment sets no MALLOC_ARENA_MAX. Only a pod that runs for hours shows whether the growth stopped. This item records the six-hour live proof and names no cause.

Acceptance criteria

Requirement: Six-hour pod without restart

The live proof MUST show a six-hour-old pod of the merged image of #4116 with restart count 0 for container service.

Scenario: Six-hour age and restart count

  • WHEN A person runs kubectl -n devops describe pod <pod> on the running roadmap-service-* pod six hours after its start.
  • THEN The Start Time is at least six hours before the read, and the Restart Count of container service is 0.

Requirement: Working set drift within 100 MiB

The live proof MUST show that container_memory_working_set_bytes of container service at the sixth hour is within 100 MiB of its value at the first hour.

Scenario: First-hour and sixth-hour working set

  • WHEN A person runs max by (pod) (container_memory_working_set_bytes{namespace="devops", container="service", pod="<pod>"}) in Grafana at the first hour and at the sixth hour.
  • THEN The absolute difference between the two values is at most 104857600 bytes.

Requirement: Anonymous mapping sum does not grow

The live proof MUST show no growth after the first hour in the sum of Rss over the /proc/1/smaps mappings with Anonymous above zero.

Scenario: First-hour and sixth-hour map sum

  • WHEN A person runs kubectl -n devops exec <pod> -c service -- cat /proc/1/smaps at the first hour and at the sixth hour, and sums the Rss of each mapping with Anonymous above zero.
  • THEN The sixth-hour sum is not greater than the first-hour sum.

Requirement: Arena variable absent

The live proof MUST show that container service runs with no MALLOC_ARENA_MAX set.

Scenario: Arena variable in the pod spec

  • WHEN A person runs kubectl -n devops get pod <pod> -o yaml and reads the env block of container service.
  • THEN The env block of container service holds no MALLOC_ARENA_MAX.

Requirement: No cause claimed

The live proof MUST record the two map sums as an observation and MUST NOT name the glibc arenas or another single cause of the growth.

Scenario: Evidence comment names no cause

  • WHEN A person writes the evidence comment after the sixth-hour read.
  • THEN The comment holds both map sums and names no arena or other single cause of the growth.

Requirement: Pending a person after the merge

A person SHALL comment the live evidence on the pull request after the pod of the merged image runs six hours.

Scenario: Six-hour evidence comment

  • WHEN The pod of the merged image has run six hours, and the person holds the two working-set values, the two map sums and the MALLOC_ARENA_MAX state.
  • THEN The pull request holds a comment with the link to the Memory: use, request and limit panel of the devops-roadmap-service dashboard, the first-hour and sixth-hour working-set values, the two map sums, the MALLOC_ARENA_MAX state and restartCount=0.

Existing Tool Considered

No alternatives check has run on this issue. Prometheus, Grafana, kubectl and the kernel cover the need. The alert RoadmapServiceMemoryNearLimit reads container_memory_working_set_bytes{namespace="devops", pod=~"roadmap-service-.+", container="service"}. The Memory: use, request and limit panel of the devops-roadmap-service dashboard graphs the same series. /proc/1/smaps of the container holds the process mappings. These tools lack one combined verdict over the restart count, the two working-set values and the map sums. None compares a first-hour value with a sixth-hour value. The change builds no code, so it has no build cost. A new devops k8s roadmap-service-memory-check command would cost about 40k tokens to build, about 5k tokens each year to keep and fix, and about one day of elapsed time for a proof that runs once.

Key questions

  • Which open tool reads the working set of container service over six hours?: Prometheus holds the series and Grafana shows it. The alert RoadmapServiceMemoryNearLimit reads container_memory_working_set_bytes{namespace="devops", pod=~"roadmap-service-.+", container="service"}. The Memory: use, request and limit panel of the devops-roadmap-service dashboard graphs the same series. [sources: k8s/devops/monitoring/prometheus-rules-values.yaml, docs/CLUSTER.md]
  • Does the Deployment set MALLOC_ARENA_MAX for container service?: No. The env block of container service holds no MALLOC_ARENA_MAX. The line in the issue body that says fix(service): roadmap-service is OOMKilled after hours #4116 sets the value is stale. [sources: k8s/devops/roadmap-service/deployment.yaml]
  • Which process does /proc/1/smaps describe in container service?: PID 1 is the devops entrypoint that runs serve --service --workers 1. The images run devops as PID 1 with no init. The Service refuses more than one worker. UvicornStarter calls uvicorn.run in that same process. So the one process of the container holds the mappings. [sources: k8s/devops/roadmap-service/deployment.yaml, src/devops_cli/server/start.py:66]
  • Should the item add a devops k8s command for the six-hour proof, or use Grafana and kubectl?: Use Grafana and kubectl. The proof runs once. The metric and the kernel file cover it. AGENTS.md rule 3 asks for an open tool before new code. (best practice) [sources: AGENTS.md, k8s/devops/monitoring/prometheus-rules-values.yaml, docs/CLUSTER.md]
    • Chosen: Grafana query and kubectl exec. The metric and the kernel file cover the proof, and the proof runs once, so it needs no new code.
    • Rejected: New devops k8s memory-check command. It adds code that the project keeps and fixes for a proof that runs once.
    • Rejected: Only the RoadmapServiceMemoryNearLimit alert. It fires at 85 percent of the limit and shows neither the drift nor the process maps.
  • Does the six-hour run show that the glibc arenas caused the growth?: No. The Deployment sets no arena variable, so the run has no arena setting to test. The proof records the two map sums as an observation and names no cause. (best practice) [sources: k8s/devops/roadmap-service/deployment.yaml]
    • Chosen: Record the mappings and name no cause. The Deployment sets no arena limit, so one run cannot separate the arenas from the two bounds of fix(service): roadmap-service is OOMKilled after hours #4116.
    • Rejected: Name the arenas as the cause. The proof has no measurement that separates the arenas from other allocations.
    • Rejected: Run again with no arena variable. The Deployment sets no such variable, so there is nothing to remove, and a second run adds six hours.
  • Which value is the baseline of the 100 MiB tolerance?: The value at the end of the first hour of the pod's run. Start-up allocations are then outside the window. The sixth-hour value is five hours later. (best practice) [sources: docs/CLUSTER.md, k8s/devops/roadmap-service/deployment.yaml]
    • Chosen: First-hour value. It skips start-up growth and matches the acceptance criterion of the issue body.
    • Rejected: Pod start value. Start-up allocations would count as growth and hide the steady state.
    • Rejected: Median of the six hours. A slow rise moves the median and hides the growth.
  • Which memory limit does the pod use during the six-hour check?: Container service requests 768Mi and limits memory to 3Gi. At the recorded growth of 100 to 150 MiB each hour, the pod stays below that limit during the six hours. So the kernel does not kill the container and the run is not cut short. [sources: k8s/devops/roadmap-service/deployment.yaml]

Fit

Fits in one pull request.

Suspected block

The pod must run six hours after the rollout of the merged image of #4116 before the sixth-hour readings exist.

Dependencies

#4116

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • k8s/devops/roadmap-service/deployment.yaml

Activity

  1. added
    source/agent
    type/test
    scope/service
    status/new
    value/medium
    effort/high
    on Nov 8, 2026
  2. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/service. The (service) scope of the title gives the scope.
    • Priority: P2-Medium. The run confirms that the memory fix holds, but it does not block other work for six hours.
    • Value: Medium. The run gives evidence that the Service stops at a flat working set, and users gain stability.
    • Effort: High. It needs a merged image, a rollout, six hours of run and manual reads of Grafana and /proc/1/smaps.
    • Related: fix(service): roadmap-service is OOMKilled after hours #4116, which asks for a different change. Both items address the OOMKilled roadmap Service, but #4116 asks for the fix and the candidate asks for a six-hour runtime verification of that fix.
  3. changed the title [-]test(service): verify the roadmap Service working set stays flat over six hours[/-] [+]test(service): Verify Service working set stays flat for six hours[/+] on Nov 8, 2026
  4. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 64 characters, and the limit is 60. The type and the scope stay.

    • Before: test(service): verify the roadmap Service working set stays flat over six hours
    • After: test(service): Verify Service working set stays flat for six hours
    • Source of the summary: the background model
  5. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 719cd43 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

  6. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  9. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  10. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highpriority/p2-mediumscope/servicesource/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions