fix(critical): Timeout-Hierarchie umkehren — innere Timeouts 3s < äußere 4s + Semaphore-Timeout + Embedding-Deadline
ROOT-CAUSE: Die Timeout-Hierarchie war umgekehrt. Der äußere wait_for(4s) in adapter.py konnte nie feuern, weil die inneren wait_for(25s) in classifier.py die Coroutine blockierten. AENDERUNGEN: - classifier.py: _llm_raw, _llm_classify, verify_confidence: 25.0s → 3.0s - classifier.py: OllamaEmbeddingClient.get_embedding: ThreadPoolExecutor mit .result(timeout=3.0) statt nacktem urllib.urlopen - router.py: _llm_semaphore.acquire() mit asyncio.wait_for(timeout=3.0) an 3 Stellen (_llm_room_lookup, _detect_recursive, _validate_sentence_marker_llm) - config.py: LLM_CONFIG timeout 10.0 → 3.0 - config.py: OLLAMA_CONFIG timeout 10.0 → 3.0 TIMEOUT-HIERARCHIE (nach Fix): adapter.py wait_for: 4.0s (äußerst) router.py semaphore acquire: 3.0s classifier.py LLM-Calls: 3.0s classifier.py Embedding-Calls: 3.0s config.py LLM_CONFIG timeout: 3.0s config.py OLLAMA_CONFIG timeout: 3.0s Der äußere 4s-Timeout gewinnt jetzt immer.
This commit is contained in:
@@ -16,7 +16,8 @@ from typing import Dict
|
||||
OLLAMA_CONFIG: dict = {
|
||||
"base_url": os.getenv("ARCHIVAR_EMBEDDING_BASE_URL", "http://localhost:11434"),
|
||||
"model": "nomic-embed-text",
|
||||
"timeout": 10.0, # Sekunden — empirisch: Ø 2.4s, Cold-Start bis 7.8s
|
||||
"timeout": 3.0, # Sekunden — HARD deadline via ThreadPoolExecutor
|
||||
# Muss KLEINER sein als äußerer 4s-Timeout in adapter.py
|
||||
"embedding_dim": 768, # nomic-embed-text produziert 768-dimensionale Vektoren
|
||||
}
|
||||
|
||||
@@ -156,7 +157,8 @@ wird sie entsprechend klassifiziert. Alles andere → FAKT.
|
||||
LLM_CONFIG = {
|
||||
"enabled": os.getenv("ARCHIVAR_ENABLE_LLM", "").strip().lower() in ("1", "true", "yes"),
|
||||
"model": "qwen2.5:7b",
|
||||
"timeout": 30.0, # Iterative Optimierung: Start 30s (19.06.2026)
|
||||
"timeout": 3.0, # HARD deadline via ThreadPoolExecutor.result(timeout=X)
|
||||
# Muss KLEINER sein als äußerer 4s-Timeout in adapter.py
|
||||
"base_url": os.getenv(
|
||||
"ARCHIVAR_LLM_BASE_URL",
|
||||
os.getenv("OLLAMA_BASE_URL", "http://localhost:11434")
|
||||
|
||||
Reference in New Issue
Block a user