Skip to content

test(oom): bump python OOM function to 512 MB to fix flaky metric assertion#1306

Open
lym953 wants to merge 2 commits into
mainfrom
yiming.luo/fix-oom-python-flake
Open

test(oom): bump python OOM function to 512 MB to fix flaky metric assertion#1306
lym953 wants to merge 2 commits into
mainfrom
yiming.luo/fix-oom-python-flake

Conversation

@lym953

@lym953 lym953 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Overview

The integration-suite: [oom] job flakes (~1 run in 3) on the python case only: out_of_memory count comes back 0 while every other runtime reports 1. It fails across unrelated branches, so it's a pre-existing flake, not a regression.

Datadog logs show the python function emits no telemetry at all on failing runs (no logs, no metric), but emits both on passing runs. At 256 MB the python3.13 runtime plus the datadog_lambda shim leave too little headroom, so when the function OOMs the kernel OOM-killer intermittently takes the extension too (Extension.Crash) before its end-of-invocation flush, dropping both logs and the metric.

Fix. Bump the python OOM function to 512 MB so the extension survives and flushes. Detection paths are unchanged (the function still hits its memory cap and emits MemoryError); other runtimes stay at 256 MB.

Testing

  • tsc --noEmit passes.
  • Functional confirmation needs several oom runs (the failure is a ~1-in-3 race); 512 MB roughly doubles the headroom, and every other runtime already passes reliably at 256 MB.

…ertion

The `integration-suite: [oom]` python case failed ~1 run in 3 with
`out_of_memory` count 0 (all other runtimes passing). Datadog logs show
the python function emitted no telemetry at all on failing runs — no
logs and no metric — while the same function emits both on passing runs.

At 256 MB the python3.13 runtime plus the `datadog_lambda` handler shim
leave too little headroom, so when the function OOMs the kernel
OOM-killer intermittently takes the extension too before it can run its
end-of-invocation flush, dropping both logs and the enhanced metric.
Bumping the python function to 512 MB keeps the extension alive to
detect and flush. Detection paths are unchanged: the function still hits
its memory cap and emits `MemoryError`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lym953 lym953 requested a review from litianningdatadog July 15, 2026 20:13
@lym953 lym953 marked this pull request as ready for review July 15, 2026 20:14
@lym953 lym953 requested a review from a team as a code owner July 15, 2026 20:14
Copilot AI review requested due to automatic review settings July 15, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces flakiness in the integration-suite: [oom] integration test by increasing memory for the Python OOM test Lambda so the Datadog extension is less likely to be OOM-killed before it can flush telemetry/metrics.

Changes:

  • Introduces a dedicated pythonOomMemorySize (512 MB) while keeping the default OOM test memory size at 256 MB for other runtimes.
  • Updates inline rationale comments explaining why Python needs additional headroom.

Comment thread integration-tests/lib/stacks/oom.ts
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 15, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

DataDog/datadog-lambda-extension | e2e-test-status (amd64)   View in Datadog   GitLab

DataDog/datadog-lambda-extension | integration-suite: [payload-size]   View in Datadog   GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8da8d85 | Docs | Datadog PR Page | Give us feedback!

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.

3 participants