jiangfucheng commented on issue #10093:
URL: https://github.com/apache/apisix/issues/10093#issuecomment-1726770376

   > @jiangfucheng `api_ctx.matched_route` is per request so even if it is set 
wrong, the subsequent request will set it again. In the next request, you can 
see that api_ctx.matched_route has empty nodes in upstream after it is 
populated by match() function. The whole issue boils down to, why the 
matched_route log has no nodes? This is calculated for each request from the 
etcd. I haven't been able to find the exact flow that can explain where exactly 
did this nodes={} from previous upstream resulted in api_ctx.matched_route's 
nodes when api_ctx is freshly calculated per request. And where exactly is the 
caching happening at that point while matching route.
   > 
   > The only caching culprit I see currently is this
   > 
   > 
https://github.com/apache/apisix/blob/57a7dcdac63a0bda55ddd41fc56a10c6144bfd51/apisix/http/router/radixtree_uri_with_parameter.lua#L38
   > 
   > But modification in _M.user_routes is only done directly by etcd.
   
   
   
   You are right, it's my mistake, `api_ctx` will be created when a new request 
comes, it does not reuse it. 
   


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