Sorry, forgot to add that I'm using Python 2.7

On Friday, February 22, 2019 at 4:35:04 PM UTC, Alex wrote:
>
> Hi Eric,
>
> I have finally managed to reproduce the issue with code I can share. The 
> attached "ReproduceGRPCIssue.zip" package contains the following:
>
> ReproduceGRPCIssue:
>
>    - BreakGRPC: Noddy C++ project that just prints "Hello World!". This 
>    is going to be the application run in a subprocess. Please compile it and 
>    put the "BreakGRPC.exe" in "ReproduceGRPCIssue\BreakGRPC\x64\Release".
>    - Services
>       - protos: contains the Test.proto file to generate the GRPC source 
>       files.
>       - src: 
>          - client.py: Simple CherryPy websocket client that talks to the 
>          CherryPy webserver.py on 127.0.0.1:9000. When opened, it sends 
>          10 requests to the webserver.py to run the GRPCCall. It sleeps 1 
> second 
>          between requests.
>          - GRPCServer.py: Implementation of the GRPCTestService running 
>          on [::]:50051. It has one rpc "GRCCall" which just prints "In 
> GRPCCall".
>          - Test_pb2/Test_pb2_grpc.py: Autogenerated python files
>          - webserver.py: CherryPy websocket server. It creates the 
>          GRPCTestStub with an insecure channel on 127.0.0.1:50051. It 
>          listens for websocket messages on 127.0.0.1:9000. When it 
>          receives a message, it creates a thread to deal with it 
> (MessageHandler). 
>          This thread uses the grpc_stub to call GRPCCall and then run the 
>          BreakGRPC.exe in a subprocess. 
>       
>  
> In order to run the above files you need to have installed cherrypy (
> https://cherrypy.org/) and ws4py(
> https://github.com/Lawouach/WebSocket-for-Python).
> The webserver looks for the BreakGRPC.exe in 
> "../../BreakGRPC/x64/Release/BreakGRPC.exe". Please update line 40 in 
> webserver.py if you change the location of the exe.
>
> To reproduce the issue:
>
>    1. Launch the GRPC server (python GRPCserver.py)
>    2. Launch the webserver (python webserver.py)
>    3. Launch the client (python client.py)
>
> You'll see "Hello World!" on the webserver command prompt and after 2 
> "Hello World!" messages, you'll get the exception:
>
> _Rendezvous: <_Rendezvous of RPC that terminated with:
>  status = StatusCode.UNKNOWN
>  details = "Stream removed"
>  debug_error_string = "{"created":"@1550849396.521000000","description":"
> Error received from peer","file":"src/core/lib/surface/call.cc","file_line
> ":1036,"grpc_message":"Stream removed","grpc_status":2}"
>   
> If you comment out line 40 in webserver.py: 
> subprocess.call('../../BreakGRPC/x64/Release/BreakGRPC.exe')
> the exception won't be raised.
>
> Also, if the webserver doesn't spawn a thread to deal with the websocket 
> message, the exception won't be raised either. To see this, comment out 
> lines 57-59 in webserver.py:
>
>       msgHandler = MessageHandler(d)
>       msgHandler.daemon = True
>       msgHandler.start()
>
> and uncomment lines 60-61 in webserver.py:
>
>       #if d['cmd'] == 'grpc_call':
>       #   cherrypy.engine.publish('grpc_call', d)
>
>
> Please let me know if you have problems trying to reproduce it.
>
> Thanks,
> Alex.
>
> On Wednesday, February 20, 2019 at 7:04:51 PM UTC, Eric Gribkoff wrote:
>>
>> Can you post the code you're using to reproduce this error? If you're 
>> using subprocess.Popen (or otherwise using fork+exec) to start the C++ grpc 
>> client process, the C++ client itself cannot be interfering with the Python 
>> process. Something could be going wrong in the gRPC core fork handlers, 
>> however - you can try running with the environment variable 
>> `GRPC_ENABLE_FORK_SUPPORT=0` to disable this feature and see if it fixes 
>> the issue.
>>
>> Also, in your step 5 you note that the C++ client isn't communicating 
>> with the server. If you remove the fork+exec of a C++ subprocess 
>> altogether, do you still see this intermittent exception in the Python 
>> client?
>>
>> Eric
>>
>> On Wed, Feb 20, 2019 at 6:57 AM Alex <negr...@gmail.com> wrote:
>>
>>> I should add that the Python client application which owns the Python 
>>> grpc client is the one that runs the C++ grpc client as a subprocess in 
>>> case that makes a difference.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "grpc.io" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to grpc-io+u...@googlegroups.com.
>>> To post to this group, send email to grp...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/grpc-io.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/grpc-io/b323fac3-978b-47c1-b1fa-555c2f62b544%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/grpc-io/b323fac3-978b-47c1-b1fa-555c2f62b544%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/871455ae-cb3c-4d08-8f27-fa8402ac6c1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to