Просмотр исходного кода

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 лет назад
Родитель
Сommit
48edcb4991
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      coriolis/cmd/worker.py

+ 1 - 1
coriolis/cmd/worker.py

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