diff --git a/litellm/proxy/health_endpoints/backlog_health.py b/litellm/proxy/health_endpoints/backlog_health.py index 7bc1f207e1a..367e28474c1 100644 --- a/litellm/proxy/health_endpoints/backlog_health.py +++ b/litellm/proxy/health_endpoints/backlog_health.py @@ -37,8 +37,6 @@ class BacklogHealth: queue_regex = re.compile(r"(?:^|\s)(\d+)/(\d+)/(\d+)(?:\s|$)") for line in output.splitlines(): - if "LISTEN" not in line: - continue if not port_regex.search(line): continue queue_match = queue_regex.search(line) diff --git a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py index 81ea6c12ebf..98670a242e7 100644 --- a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py +++ b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py @@ -502,6 +502,18 @@ tcp4 2/0/128 *.4000 *.* LISTEN assert result["listen_queue_max"] == 128 +def test_parse_macos_netstat_listen_queue_two_column_format(): + sample_output = """Current listen queue sizes (qlen/incqlen/maxqlen) +Listen Local Address +3/0/128 *.4011 +""" + result = BacklogHealth.parse_macos_netstat_listen_queue( + output=sample_output, port=4011 + ) + assert result["listen_queue_current"] == 3 + assert result["listen_queue_max"] == 128 + + def test_get_cached_listen_queue_stats_uses_cache(): mock_stats = { "status": "healthy",