wxbty commented on code in PR #9663:
URL: https://github.com/apache/apisix/pull/9663#discussion_r1245141531


##########
apisix/plugins/limit-conn/init.lua:
##########
@@ -119,7 +119,11 @@ function _M.decrease(conf, ctx)
             if ctx.proxy_passed then
                 latency = ctx.var.upstream_response_time
             else
-                latency = ctx.var.request_time - delay
+                if ctx.var.request_time ~= nil then
+                    latency = ctx.var.request_time - delay
+                else
+                    latency = ctx.var.upstream_response_time

Review Comment:
   These two variables can be nil, but the calculation will throw an exception. 
In fact, the limit-conn plug-in is invalid in stream mode. Can we return 
directly here?



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to