tzssangglass commented on issue #8345: URL: https://github.com/apache/apisix/issues/8345#issuecomment-1318069142
hi @Fabriceli , I eventually tracked it down here: https://github.com/openresty/lua-resty-dns/blob/master/lib/resty/dns/resolver.lua#L870-L896 ``` for _ = 1, 128 do buf, err = sock:receive(4096) if err then local server = _get_cur_server(self) err = "failed to receive reply from UDP server " .. concat(server, ":") .. ": " .. err break end if buf then local answers answers, err = parse_response(buf, id, opts) if err == "truncated" then answers, err = _tcp_query(self, query, id, opts) end if err and err ~= "id mismatch" then break end if answers then return answers, nil, tries end end -- only here in case of an "id mismatch" end end ``` 1. first query "service-name-x.service.dc-name-x.consul" from `x.x.x.x:8600` 2. then get the `buf`, and `err` is nil, so it won't go into ` if err then`, just `parse_response(buf, id, opts)` and the answers is ``` { errcode = 3, errstr = "name error" } ``` 3. and then return this error directly, won't try to query on `y.y.y.y:8600` again. > or multi DNS, APISIX is not work like this ??: <img width="845" alt="image" src="https://user-images.githubusercontent.com/30819887/202358605-08407b84-24e2-4af1-8229-7cc99efc5057.png"> yes -- 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]
