kezhenxu94 commented on pull request #116:
URL: https://github.com/apache/skywalking-python/pull/116#issuecomment-768959233


   > As for the timeout issue, I had a quick glance of the codes and guess 
(don't have too much time ATM to look thoroughly and test myself) the reason 
may be the changes from `self.traces_reporter.report(generator())` to 
`self.traces_reporter.report(iter([s]))`, the former `generator()` was blocking 
the `self.traces_reporter.report` and may cause timeout, while the latter one 
doesn't.
   
   OK just did a quick experiment, seems to be the case, I just changed a 
shorter timeout intentionally and the codes before this PR throws timeout 
exception constantly, while those after this PR don't.
   
   ```diff
   diff --git a/skywalking/client/grpc.py b/skywalking/client/grpc.py
   index 734d3bb..81de589 100644
   --- a/skywalking/client/grpc.py
   +++ b/skywalking/client/grpc.py
   @@ -55,4 +55,4 @@ class 
GrpcTraceSegmentReportService(TraceSegmentReportService):
            self.report_stub = TraceSegmentReportServiceStub(channel)
    
        def report(self, generator):
   -        self.report_stub.collect(generator)
   +        self.report_stub.collect(generator, timeout=3)
   ```
   
   
   ```text
   skywalking [Thread-21] [DEBUG] grpc channel connectivity changed, 
[ChannelConnectivity.READY -> ChannelConnectivity.READY]
   Traceback (most recent call last):
     File 
"/Users/kezhenxu94/workspace/skywalking-python/venv/lib/python3.8/site-packages/apache_skywalking-0.5.0-py3.8.egg/skywalking/agent/protocol/grpc.py",
 line 122, in report
       self.traces_reporter.report(generator())
     File 
"/Users/kezhenxu94/workspace/skywalking-python/venv/lib/python3.8/site-packages/apache_skywalking-0.5.0-py3.8.egg/skywalking/client/grpc.py",
 line 58, in report
       self.report_stub.collect(generator, timeout=3)
     File 
"/Users/kezhenxu94/workspace/skywalking-python/venv/lib/python3.8/site-packages/grpc/_channel.py",
 line 1011, in __call__
       return _end_unary_response_blocking(state, call, False, None)
     File 
"/Users/kezhenxu94/workspace/skywalking-python/venv/lib/python3.8/site-packages/grpc/_channel.py",
 line 729, in _end_unary_response_blocking
       raise _InactiveRpcError(state)
   grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated 
with:
        status = StatusCode.DEADLINE_EXCEEDED
        details = "Deadline Exceeded"
        debug_error_string = 
"{"created":"@1611829792.286230000","description":"Error received from peer 
ipv4:127.0.0.1:11800","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Deadline
 Exceeded","grpc_status":4}"
   >
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to