jiangfucheng commented on issue #10093: URL: https://github.com/apache/apisix/issues/10093#issuecomment-1725524437
@wklken Thanks for your detailed description. Based on your description, I think there are two issues that need to be answered. 1. Why APISIX will print error log with `failed to set upstream: no valid upstream node` after parse domain failed. I think you already found the reason for this: `parse_domain_for_nodes()` function should return `nil, error` if dns parse failed. https://github.com/apache/apisix/blob/9b2031a61c8af9c010a923eea89c0dd029e0d971/apisix/utils/upstream.lua#L64-L86 2. Why the `http_access_phase()` function print the matched route with a `nil` node field in your second request? https://github.com/apache/apisix/blob/9b2031a61c8af9c010a923eea89c0dd029e0d971/apisix/init.lua#L494-L504 I think it was caused by `api_ctx.matched_route = route` this line, it changed the route config in memory. (Note that I think it did not just change the copy table but changed the origin route table). For the above two issues, I think we just fix the return value in `parse_domain_for_nodes` function enough. For other issues, I will continue to try to debug the code to give my opinion. Another, I have a question, in the above description, you commented `handle_upstream will never call parse_domain_for_nodes function` in the second request, How do you get the conclusion of this, I find the `parse_domain_for_nodes` function is not record related logs to indicate the function has been executed. (I have been quite busy with work recently, and I will help you troubleshoot this issue as soon as possible in my spare time) -- 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: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org