Reputation: 47
from multiprocessing import Process, Manager
def frames_process(self):
# fork process
self.frames_flag.value = True
self.f_process = Process(target=self.frames_handle)
self.f_process.start()
def default_cb(call_future):
try:
resp = call_future.result()
logging.info("default_cb called {}".format(resp))
return resp
except Exception as e:
logging.error("future_callback error: {}".format(e))
I use Python2 and grpc
The error is StatusCode.UNAVAILABLE
Thanks in advance.
Upvotes: 0
Views: 911
Reputation: 4058
It's not clear to me from the code snippets how exactly your client code is intended to work or when it is invoking fork (via the multiprocessing libary), but gRPC Python clients are not, by default, compatible with the fork syscall. If you are forking at any time after creating a gRPC Python channel, this may explain the errors you are encountering. You can try running with the environment variable GRPC_ENABLE_FORK_SUPPORT=1
, which was added in gRPC Python v1.15.0 to turn on client-side fork support.
Upvotes: 1