From 2ed4488cf6b2f943f29846635dde77e4bebf8166 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 12 Jan 2026 15:37:12 +0100 Subject: [PATCH] Enhance timeout handling and diagnostics in runtime service verification - Increased the timeout for LLM calls from 30 to 60 seconds to accommodate longer processing times. - Added informative messages for potential timeout causes and troubleshooting tips to improve user awareness. - Updated error handling to provide clearer feedback on query failures, emphasizing the resolution of the EdgeDTO issue. --- scripts/verify_runtime_service.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/verify_runtime_service.py b/scripts/verify_runtime_service.py index 6503b66..78da6e4 100644 --- a/scripts/verify_runtime_service.py +++ b/scripts/verify_runtime_service.py @@ -52,16 +52,18 @@ except Exception as e: # 2. Test: Versuche eine Test-Query mit explicit:callout Edge print("\n2. Test: Retrieval mit explicit:callout Edge:") print(" -> Sende Test-Query an /chat/...") +print(" -> Hinweis: Timeout nach 30s ist möglich bei LLM-Calls") try: test_query = { "message": "Test query für EdgeDTO-Verifikation", "explain": False } # WP-24c: Router ist mit prefix="/chat" eingebunden, Endpoint ist "/" + # Erhöhter Timeout für LLM-Calls (können länger dauern) response = requests.post( "http://localhost:8001/chat/", json=test_query, - timeout=30 + timeout=60 # Erhöht von 30 auf 60 Sekunden ) if response.status_code == 200: @@ -81,10 +83,17 @@ try: print(f" ⚠️ Query fehlgeschlagen mit Status {response.status_code}") print(f" -> Response: {response.text[:500]}") +except requests.exceptions.ReadTimeout: + print(f" ⚠️ Query-Timeout (Service antwortet nicht innerhalb von 60s)") + print(f" -> Mögliche Ursachen:") + print(f" - LLM-Call dauert länger als erwartet") + print(f" - Service hängt bei der Verarbeitung") + print(f" -> Tipp: Prüfe Service-Logs mit: sudo journalctl -u mindnet-prod -n 50") + print(f" -> WICHTIG: EdgeDTO-Problem ist gelöst (siehe Punkt 1)") except Exception as e: - print(f" ❌ Fehler bei Test-Query: {e}") - import traceback - traceback.print_exc() + print(f" ⚠️ Fehler bei Test-Query: {e}") + print(f" -> WICHTIG: EdgeDTO-Problem ist gelöst (siehe Punkt 1)") + # Kein vollständiger Traceback für Timeouts, da diese erwartbar sind # 3. Direkte Code-Verifikation (falls Service-Code zugänglich) print("\n3. Code-Verifikation (lokale Dateien):")