MK

acme/payments-api

feat(settlements): add nightly batch reconciler

Status
Failed
Commit
9f2c1d4main
Environment
productionpayments-prod
Duration
2m 26s
Started
Aug 14, 09:121h ago
Author
mara.k
Triggered by
push to main
Replicas
1 / 4 ready
Image
ghcr.io/acme/payments-api:9f2c1d4

Pipeline

Build → manifest → deploy → verify
  1. Step 11m 14s
    Build image

    ghcr.io/acme/payments-api:9f2c1d4 — 214 MB, 12 layers

    Started 09:12:05 UTC

  2. Step 23s
    Generate manifests

    4 resources generated for namespace payments-prod

    Started 09:13:19 UTC

  3. Step 328s
    Deploy to cluster

    Rollout started — 4 replicas, maxSurge 1, maxUnavailable 0

    Started 09:13:22 UTC

  4. Step 441s
    Verify rolloutBlocked here

    3 of 4 pods OOMKilled before passing the readiness probe

    Started 09:13:50 UTC

Run logs

09:12:05infoCloning acme/payments-api at 9f2c1d4 (branch main)
09:12:11infoDetected build system: Gradle 8.7 (JVM 21)
09:12:44infoBUILD SUCCESSFUL in 33s — 84 tasks, 61 from cache
09:13:02debugLayer cache hit ratio 0.83 (10/12 layers reused)
09:13:17infoPushed ghcr.io/acme/payments-api:9f2c1d4 (sha256:1b7d0e9c…)
09:13:19infoGenerating manifests for namespace payments-prod
09:13:20infoWrote deployment.yaml, service.yaml, ingress.yaml, configmap.yaml
09:13:21warnresources.limits.memory unchanged at 256Mi while a new background worker was detected
09:13:22infoApplying 4 resources to cluster acme-eu-west-1
09:13:24infodeployment.apps/payments-api configured
09:13:24infoservice/payments-api unchanged
09:13:25infoingress.networking.k8s.io/payments-api unchanged
09:13:38infoWaiting for rollout: 1 of 4 updated replicas available
09:13:50infoProbing readiness endpoint GET /healthz on 4 pods
09:14:02infopod/payments-api-7c9f4d8b6-x2klm is Ready (1/1)
09:14:09warnpod/payments-api-7c9f4d8b6-q8vtz memory usage 249Mi of 256Mi limit (97%)
09:14:14errorpod/payments-api-7c9f4d8b6-q8vtz terminated: OOMKilled (exit code 137)
09:14:16errorpod/payments-api-7c9f4d8b6-n4rjd terminated: OOMKilled (exit code 137)
09:14:21errorpod/payments-api-7c9f4d8b6-t6wpq terminated: OOMKilled (exit code 137)
09:14:22warn3 pods entered CrashLoopBackOff, restarting in 10s
09:14:27debugContainer last state: reason=OOMKilled, startedAt=09:14:04Z, finishedAt=09:14:14Z
09:14:29errorReadiness gate failed: 1 of 4 replicas available, minimum required is 3
09:14:31errorDeployment failed after 2m26s — previous revision left in service
Showing 23 of 23 lines

DevMate summary

high confidence

What happened

Rollout blocked by memory limits, not by your code

The image built and the manifests applied cleanly. During verification, 3 of 4 pods were OOMKilled about 10 seconds after start and fell into CrashLoopBackOff, so the rollout never reached the minimum of 3 available replicas. The new nightly batch reconciler loads settlement batches into memory at boot, which pushes steady-state usage to roughly 249Mi against a 256Mi container limit that has not changed since March. Traffic was never shifted — the previous revision (2e7f83b) is still serving production.

Suggested fixes

  1. 1

    Raise the memory limit to 512Mi

    The reconciler needs headroom above the 249Mi observed peak. Doubling the limit leaves ~50% margin and matches what identity-service runs with.

    bash
    kubectl set resources deployment/payments-api -n payments-prod --limits=memory=512Mi --requests=memory=384Mi
  2. 2

    Stream settlement batches instead of loading them at boot

    SettlementReconciler.loadPendingBatches() reads the full result set into a list. Paging it at 500 rows would keep the container under 300Mi without changing the limit.

  3. 3

    Roll back while you decide

    Production is already on the previous revision, but rolling back explicitly clears the CrashLoopBackOff pods and stops the restart noise in alerts.

    bash
    kubectl rollout undo deployment/payments-api -n payments-prod

Generated manifests

4 resources
  • deployment.yaml

    Deployment · payments-api

    payments-prod
  • service.yaml

    Service · payments-api

    payments-prod
  • ingress.yaml

    Ingress · payments-api

    payments-prod
  • configmap.yaml

    ConfigMap · payments-api-config

    payments-prod