Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: all requests on the upstream return 500 When the one node domain dns resolution timeout , even if the other node is ok #3342

Closed
redynasc opened this issue Jan 19, 2021 · 6 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@redynasc
Copy link
Contributor

redynasc commented Jan 19, 2021

Issue description
all requests on the upstream return 500 When the one node’s domain dns resolution timeout , even if the other node is ok

Environment

apisix version : 1.5
OS: Linux d1-beta-node-0004 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
OpenResty / Nginx version: (cmd: nginx -V or openresty -V)
nginx version: openresty/1.17.8.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.1.1g 21 Apr 2020
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_MAX_ERROR_STR=49152 -I/usr/local/openresty/pcre/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.17 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.8 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/pcre/lib -Wl,-rpath,/usr/local/openresty/pcre/lib' --with-openssl=/tmp/openssl-1.1.1g --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-md5-asm --with-sha1-asm --with-pcre-jit --with-stream --with-stream_ssl_module --with-threads --with-openssl-opt=-g --with-stream --with-stream_ssl_preread_module

Minimal test code / Steps to reproduce the issue

1.Create an upstream, like this
"nodes":{
"domain1-ok:8080":100,
"domain2-ok:8080":100,
"domain3-ok:8080":100
}

  1. then requests return 500

What's the actual result? (including assertion message & call stack if applicable)
one node DNS timeout ,all requests return 500

What's the expected result?
one node DNS timeout ,the request should be forwarded to other node

@spacewander
Copy link
Member

@membphis
Maybe we can ignore the failed DNS response?

@membphis
Copy link
Member

Maybe we can ignore the failed DNS response?

agree, and need to write an error log for this case.

if there is no healthy node, we should return 503 for this case.

@membphis membphis added the bug Something isn't working label Jan 20, 2021
@spacewander
Copy link
Member

We returns 502 when no endpoint can be selected, maybe returns 502 for this case is better?

@membphis
Copy link
Member

502 means the upstream is running but cannot respond to requests normally
503 means the upstream can not working (stoped or restarting)

so I think we should use 503 if there is no healthy upstream node.

@spacewander
Copy link
Member

@redynasc
Would you contribute a PR for it?

@spacewander
Copy link
Member

Solved by #3398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants