Răsfoiți Sursa

Do not cache transport in worker

The worker process forks via multiprocessing when executing
provider code. This means that the transport needs to be initialized
after forking, in order for the provider to be able to communicate
with the conductor.

This means that there will be one transport creater per each python
thread that gets spawned and tries to communicate via RPC.

For the rest of the services, each process will have one transport,
regardless of how many threads it spawns.
Gabriel Adrian Samfira 4 ani în urmă
părinte
comite
48edcb4991
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      coriolis/cmd/worker.py

+ 1 - 1
coriolis/cmd/worker.py

@@ -31,7 +31,7 @@ def main():
     server = service.MessagingService(
     server = service.MessagingService(
         constants.WORKER_MAIN_MESSAGING_TOPIC,
         constants.WORKER_MAIN_MESSAGING_TOPIC,
         [rpc_server.WorkerServerEndpoint()],
         [rpc_server.WorkerServerEndpoint()],
-        rpc_server.VERSION, worker_count=worker_count)
+        rpc_server.VERSION, worker_count=worker_count, init_rpc=False)
     launcher = service.service.launch(
     launcher = service.service.launch(
         CONF, server, workers=server.get_workers_count())
         CONF, server, workers=server.get_workers_count())
     launcher.wait()
     launcher.wait()