Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions airbyte_cdk/utils/memory_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class MemoryMonitor:
(default 5000) to 100 messages to narrow the race window near OOM.

**Fail-fast:** Raises ``AirbyteTracedException`` with
``FailureType.transient_error`` when *both*:
``FailureType.system_error`` when *both*:

1. Cgroup usage >= 95% of the container limit (container is near OOM-kill)
2. Anonymous memory >= 85% of *current cgroup usage* (most of the charged
Expand Down Expand Up @@ -296,7 +296,7 @@ def check_memory_usage(self) -> None:
f"Thresholds: cgroup >= {int(_CRITICAL_THRESHOLD * 100)}%, "
f"anon share of usage >= {int(_ANON_SHARE_OF_USAGE_THRESHOLD * 100)}%."
),
failure_type=FailureType.transient_error,
failure_type=FailureType.system_error,
)
elif not self._critical_logged:
self._critical_logged = True
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/utils/test_memory_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def test_raises_when_cgroup_critical_and_anon_share_of_usage_above_threshold() -
):
with pytest.raises(AirbyteTracedException) as exc_info:
monitor.check_memory_usage()
assert exc_info.value.failure_type == FailureType.transient_error
assert exc_info.value.failure_type == FailureType.system_error
assert "critical threshold" in (exc_info.value.message or "")
assert "96%" in (exc_info.value.message or "")
assert "anon share of usage" in (exc_info.value.internal_message or "")
Expand Down
Loading