fix: add timeout to final wait() in stop_server to prevent infinite hang

This commit is contained in:
Andy Lee
2025-08-07 18:40:57 -07:00
parent e409933149
commit c799d61a5a

View File

@@ -387,7 +387,12 @@ class EmbeddingServerManager:
# Clean up process resources to prevent resource tracker warnings
try:
self.server_process.wait() # Ensure process is fully cleaned up
self.server_process.wait(timeout=1) # Give it one final chance with timeout
except subprocess.TimeoutExpired:
logger.warning(
f"Process {self.server_process.pid} still hanging after all kill attempts"
)
# Don't wait indefinitely - just abandon it
except Exception:
pass