yxudong opened a new issue #7004:
URL: https://github.com/apache/skywalking/issues/7004


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [x] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Bug
   - Which version of SkyWalking, OS, and JRE?
   https://github.com/apache/skywalking-nginx-lua
   
   - What happened?
   
   Hi,
   
   In the skywalking-nginx-lua Doc, skywalking_tracer:finish() function will be 
called in body_filter_by_lua_block.
   But in some case, the http request will not execute body_filter_by_lua 
phase. so this function will not be called.
   
   example:
       location = xxxxx/xxxxxx {
           rewrite_by_lua_block {
               skywalking_tracer:start("upstream service")
           }
   
           proxy_pass http://xxxxxxxxxx;
           proxy_connect_timeout 1;
           proxy_send_timeout 1;
           proxy_read_timeout 1;
   
           body_filter_by_lua_block {
               if ngx.arg[2] then
                   skywalking_tracer:finish()
               end
           }
   
           log_by_lua_block {
               skywalking_tracer:prepareForReport()
           }
       }
   
      the proxy_read_timeout config is 1s, but if upstream reponse time more 
than that, nginx will has error log
   
   >  upstream timed out (110: Connection timed out) while reading response 
header from upstream, xxxxxxxxxx
   
     In this case, the http request will not execute body_filter_by_lua phase, 
skywalking_tracer:finish() function is not be called also.
   
     So skywalking_tracer:finish() should execute in log_by_lua_block, in order 
to record upsteam status correctly.
     I tried to call skywalking_tracer:finish() in log_by_lua_block, it's work 
in this case.
   


-- 
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