Skip to content

Commit 10fc815

Browse files
devin-ai-integration[bot]bot_apk
andcommitted
refactor: raise anonymous RSS threshold from 80% to 90%
Per review feedback, increase _ANON_RSS_THRESHOLD from 0.80 to 0.90 to align with the conservative 98% cgroup threshold. Start stricter and relax later once fleet data is available. Co-Authored-By: bot_apk <apk@cognition.ai>
1 parent af3ca82 commit 10fc815

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

airbyte_cdk/utils/memory_monitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# This dual-condition avoids false positives from reclaimable kernel page cache
3535
# and file-backed / shared resident pages that inflate VmRSS.
3636
_CRITICAL_THRESHOLD = 0.98
37-
_ANON_RSS_THRESHOLD = 0.80
37+
_ANON_RSS_THRESHOLD = 0.90
3838

3939
# Check interval (every N messages)
4040
_DEFAULT_CHECK_INTERVAL = 5000
@@ -83,7 +83,7 @@ class MemoryMonitor:
8383
``FailureType.system_error`` when *both*:
8484
8585
1. Cgroup usage >= 98% of the container limit (container is near OOM-kill)
86-
2. Process anonymous RSS (``RssAnon``) >= 80% of the container limit
86+
2. Process anonymous RSS (``RssAnon``) >= 90% of the container limit
8787
(pressure is from process-private anonymous memory, not elastic kernel
8888
page cache or file-backed resident pages)
8989
@@ -176,7 +176,7 @@ def check_memory_usage(self) -> None:
176176
**Logging:** WARNING on every check above 95%.
177177
178178
**Fail-fast (when enabled):** If cgroup usage >= 98% *and* process
179-
anonymous RSS (``RssAnon``) >= 80% of the container limit, raises
179+
anonymous RSS (``RssAnon``) >= 90% of the container limit, raises
180180
``AirbyteTracedException`` with ``FailureType.system_error`` so the
181181
platform receives a clear error message instead of an opaque OOM-kill.
182182
If ``RssAnon`` is unavailable, logs a warning and skips fail-fast.

unit_tests/utils/test_memory_monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Anonymous RSS mock values (in kB as they appear in /proc/self/status RssAnon field).
3131
# VmRSS is intentionally kept high in the "low anon" mock to prove the metric choice matters:
3232
# VmRSS can be inflated by file-backed pages while RssAnon stays low.
33-
_MOCK_ANON_HIGH = "RssAnon:\t 820000 kB\n" # ~82% of 1 GB (above 80% threshold)
33+
_MOCK_ANON_HIGH = "RssAnon:\t 920000 kB\n" # ~92% of 1 GB (above 90% threshold)
3434
_MOCK_ANON_LOW_VMRSS_HIGH = (
3535
"VmRSS:\t 900000 kB\n" # ~90% of 1 GB — high total RSS
3636
"RssAnon:\t 500000 kB\n" # ~50% of 1 GB — low anonymous RSS

0 commit comments

Comments
 (0)