فهرست منبع

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 سال پیش
والد
کامیت
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(
     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()