Fix duplicate backend startup in cluster client

- Removed backend process startup from cluster_client.py since vidai.py already starts it for client mode
- This prevents 'Address already in use' error when running as cluster client
- Cluster client now only manages worker processes, not the backend
parent 16b95c28
......@@ -129,7 +129,7 @@ class ClusterClient:
self.connected = False
async def start_local_processes(self) -> None:
"""Start local backend and worker processes based on available backends (GPU and CPU)."""
"""Start local worker processes based on available backends (GPU and CPU)."""
from .compat import detect_gpu_backends, get_available_backends
gpu_info = detect_gpu_backends()
......@@ -140,14 +140,6 @@ class ClusterClient:
# Only start processes if not already started
if not self.local_processes:
# Start local backend process first
backend_cmd = [sys.executable, '-m', 'vidai.backend']
self.local_processes['backend'] = subprocess.Popen(backend_cmd)
print("Started local backend process")
# Give backend time to start up
await asyncio.sleep(2)
# Start analysis workers for available backends (including CPU)
for backend in available_backends:
proc_name = f'analysis_{backend}'
......@@ -489,13 +481,10 @@ class ClusterClient:
except:
pass
# Clear the processes dict (but keep backend)
backend_proc = self.local_processes.get('backend')
# Clear the processes dict
self.local_processes.clear()
self.process_weights.clear()
self.process_models.clear()
if backend_proc:
self.local_processes['backend'] = backend_proc
# Check if backend is available
from .compat import get_available_backends
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment