$ python greeter_client.py
Greeter client received: Hello, you!
$ python greeter_client.py
Greeter client received: Hello, you!
$ python3.6 greeter_server_preexec.py
E1104 01:27:37.862233836 24328 tcp_server_posix.cc:210] Failed accept4: Invalid argument
$ python greeter_client.py
Traceback (most recent call last):
File "greeter_client.py", line 35, in <module>
run()
File "greeter_client.py", line 30, in run
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
File "/home/dcoles/workspace/grpc/grpc/examples/python/helloworld/venv/local/lib/python3.6/site-packages/grpc/_channel.py", line 533, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/home/dcoles/workspace/grpc/grpc/examples/python/helloworld/venv/local/lib/python3.6/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Received RST_STREAM with error code 2"
debug_error_string = "{"created":"@1541294857.862411425","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1017,"grpc_message":"Received RST_STREAM with error code 2","grpc_status":13}"
>
$ python greeter_client.py
Traceback (most recent call last):
File "greeter_client.py", line 35, in <module>
run()
File "greeter_client.py", line 30, in run
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
File "/home/dcoles/workspace/grpc/grpc/examples/python/helloworld/venv/local/lib/python3.6/site-packages/grpc/_channel.py", line 533, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/home/dcoles/workspace/grpc/grpc/examples/python/helloworld/venv/local/lib/python3.6/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Connect Failed"
debug_error_string = "{"created":"@1541294859.542303123","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2721,"referenced_errors":[{"created":"@1541294859.542300691","description":"Pick Cancelled","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":241,"referenced_errors":[{"created":"@1541294859.542285256","description":"Connect Failed","file":"src/core/ext/filters/client_channel/subchannel.cc","file_line":689,"grpc_status":14,"referenced_errors":[{"created":"@1541294859.542274056","description":"Failed to connect to remote host: OS Error","errno":111,"file":"src/core/lib/iomgr/tcp_client_posix.cc","file_line":205,"os_error":"Connection refused","syscall":"connect","target_address":"ipv4:127.0.0.1:50051"}]}]}]}"
>
What version of gRPC and what language are you using?
gRPC 1.16.0 for Python
What operating system (Linux, Windows, …) and version?
Ubuntu 18.04 LTS (4.15.13-x86_64-linode106) for x86_64
What runtime / compiler are you using (e.g. python version or version of gcc)
Python 3.6.5
What did you do?
python/helloworld/greeter_server.pyexampleos.fork()+os.execl(): greeter_server_fork_exec.pyos.fork()+os._exit(): greeter_server_fork_exit.pysubprocess+preexec_fn: greeter_server_preexec.pypython3 greeter_server.pypython3 greeter_client.pymultiple timesThis seems to be the root cause of #14436.
What did you expect to see?
What did you see instead?
NOTE: These examples work correctly under Python 2.7 or if using
subprocesswithout apreexec_fn(does not cause_posixsubprocessto call back into Python).On the server:
On the client:
Anything else we should know about your project / environment?
gRPC for Python 2.7 and 3.6 was installed using
pipto ensure I was using the latest version.