From 57f527eb02b849ee5125692de074f6f64a7c13aa Mon Sep 17 00:00:00 2001 From: Ricardo-M-L <69202550+Ricardo-M-L@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:08:52 +0800 Subject: [PATCH] Add missing timeout to ragflow server health check (#14311) ### What problem does this PR solve? `check_ragflow_server_alive()` in `api/utils/health_utils.py` calls `requests.get(url)` without a `timeout` parameter. Unlike `check_minio_alive()` which correctly specifies `timeout=10`, this health check can hang indefinitely if the server is unresponsive. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) ### Changes Added `timeout=10` to the `requests.get()` call, consistent with `check_minio_alive()`. Co-authored-by: Claude Opus 4.7 --- api/utils/health_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/utils/health_utils.py b/api/utils/health_utils.py index 288eb79ff6..34f098b8c9 100644 --- a/api/utils/health_utils.py +++ b/api/utils/health_utils.py @@ -293,7 +293,7 @@ def check_ragflow_server_alive(): url = f'http://{settings.HOST_IP}:{settings.HOST_PORT}/api/v1/system/ping' if '0.0.0.0' in url: url = url.replace('0.0.0.0', '127.0.0.1') - response = requests.get(url) + response = requests.get(url, timeout=10) if response.status_code == 200: return {"status": "alive", "message": f"Confirm elapsed: {(timer() - start_time) * 1000.0:.1f} ms."} else: