diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e73e411..d7146f7d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Newer updates can be found here: [GitHub Release Notes](https://github.com/airby # Changelog +## 6.5.3 + +Improve source container memory exhaustion error message. + ## 6.5.2 bugfix: Ensure that streams with partition router are not executed concurrently diff --git a/airbyte_cdk/utils/memory_monitor.py b/airbyte_cdk/utils/memory_monitor.py index ac35735f9..833dc0b9c 100644 --- a/airbyte_cdk/utils/memory_monitor.py +++ b/airbyte_cdk/utils/memory_monitor.py @@ -287,7 +287,7 @@ def check_memory_usage(self) -> None: anon_share = anon_bytes / usage_bytes if anon_share >= _ANON_SHARE_OF_USAGE_THRESHOLD: raise AirbyteTracedException( - message=f"Source memory usage exceeded critical threshold ({usage_percent}% of container limit).", + message="Source container memory exceeded the critical usage limit.", internal_message=( f"Cgroup memory: {_format_bytes(usage_bytes)} / " f"{_format_bytes(limit_bytes)} ({usage_percent}%). " diff --git a/unit_tests/utils/test_memory_monitor.py b/unit_tests/utils/test_memory_monitor.py index 27975707b..ffbfc89ec 100644 --- a/unit_tests/utils/test_memory_monitor.py +++ b/unit_tests/utils/test_memory_monitor.py @@ -388,9 +388,9 @@ 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.system_error - assert "critical threshold" in (exc_info.value.message or "") - assert "96%" in (exc_info.value.message or "") + assert exc_info.value.message == "Source container memory exceeded the critical usage limit." assert "anon share of usage" in (exc_info.value.internal_message or "") + assert "96%" in (exc_info.value.internal_message or "") # Human-readable byte formatting: 960 MB usage, 1.00 GB limit, 840 MB anon. internal = exc_info.value.internal_message or "" assert "960.00 MB" in internal