diff --git a/airbyte_cdk/utils/memory_monitor.py b/airbyte_cdk/utils/memory_monitor.py index e9f6205637..ac35735f91 100644 --- a/airbyte_cdk/utils/memory_monitor.py +++ b/airbyte_cdk/utils/memory_monitor.py @@ -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 @@ -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 diff --git a/unit_tests/utils/test_memory_monitor.py b/unit_tests/utils/test_memory_monitor.py index 6fdd8e8fef..27975707bc 100644 --- a/unit_tests/utils/test_memory_monitor.py +++ b/unit_tests/utils/test_memory_monitor.py @@ -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 "")