http 503 exception occurs during Pressure test and continuous reload kong.yml via Admin API (db_less)
Is there an existing issue for this?
- [X] I have searched the existing issues
Kong version ($ kong version)
kong 2.8.1
Current Behavior
-
When I did a pressure test on Kong via jmeter(60 threads)ļ¼During this process, I request the admin API /config to reload kong.yml via jmeter(1 thread), http 503 Service Temporarily Unavailable happens during Pressure test(The probability is 0.29%)
-
if I do not reload kong.yml During pressure test ,there was not http 503 error

Expected Behavior
When I did a pressure test on Kongļ¼all request return http 200 , have no http 503 exception In the production environment, we will frequently update kong.yml
Steps To Reproduce
1ćkong version 2.8.1, CentOS Linux release 7.3.1611 (Core) 8C
2ćyum install kong-2.8.1.el7.amd64.rpm
3ćupdate kong.conf and start kong
4ćbegin pressure test on Kong and reload kong.yml via jmeter
Anything else?
-
kong.config worker_consistency = strict log_level = info mem_cache_size = 256m database = off
-
kong.yml _format_version: "2.1"
_transform: true
services:
- name: static-front-perf-sd
host: static-front-perf-sd
connect_timeout: 10000
protocol: http
routes:
- strip_path: false
preserve_host: true
name: static-front-perf-sd
hosts:
- static.test.com methods:
- GET
- POST paths:
- /
- strip_path: false
preserve_host: true
name: static-front-perf-sd
hosts:
- name: testin-web-perf-sd
host: testin-web-perf-sd
connect_timeout: 10000
protocol: http
routes:
- strip_path: false
preserve_host: true
name: testin-web-perf-sd
hosts:
- in.test.com methods:
- GET
- POST paths:
- / upstreams:
- strip_path: false
preserve_host: true
name: testin-web-perf-sd
hosts:
- name: testin-web-perf-sd
healthchecks:
active:
https_verify_certificate: true
type: http
http_path: /detect
timeout: 3
concurrency: 10
healthy:
successes: 3
interval: 10
unhealthy:
tcp_failures: 3
timeouts: 3
http_failures: 3
interval: 10
passive:
type: http
healthy:
successes: 3
unhealthy:
tcp_failures: 3
timeouts: 3
http_failures: 3
targets:
- target: 10.16.95.67:10829 weight: 10
- target: 10.16.95.68:10829 weight: 10
- name: testin-web-perf-sd-grayroute
healthchecks:
active:
https_verify_certificate: true
type: http
http_path: /detect
timeout: 3
concurrency: 10
healthy:
successes: 3
interval: 10
unhealthy:
tcp_failures: 3
timeouts: 3
http_failures: 3
interval: 10
passive:
type: http
healthy:
successes: 3
unhealthy:
tcp_failures: 3
timeouts: 3
http_failures: 3
targets:
- target: 10.16.95.69:10829 weight: 5
- target: 10.16.95.67:10829 weight: 5
- target: 10.16.95.68:10829 weight: 5
- there was no error log in error.log

- try to add debug code in kong
why appear http 503ļ¼because balancer.healthy is false, kong/runloop/balancer/init.lua --line 289ļ¼kong/runloop/balancer/balancers.lua --line 563 ļ¼
so I add some debug log in balancers.lua and targets.lua
balancers.lua

targets.lua

Continue pressure test the error.log
when execute method create_balancer_exclusive() , Sometimes the following occurs ļ¼target.addresses is has value and address.available is trueļ¼so it never update balancer.healthy During create_balancer
in error.log ,some nginx worker use pre cacheļ¼ is there a bug in kong cache?

-
how can I solve or avoid the problem use different upstream name when request admin api /config? when targets.fetch_targets(upstream) in balancers.lua do not use cache , read from db can solve this problem(db_less mode)
-
similar issue https://github.com/Kong/kong/issues/7543
@bungle
Sounds related to #8976
@kanbo Have you solved the problem?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Dear contributor,
We are automatically closing this issue because it has not seen any activity for three weeks. We're sorry that your issue could not be resolved. If any new information comes up that could help resolving it, please feel free to reopen it.
Your contribution is greatly appreciated!
Please have a look our pledge to the community for more information.
Sincerely, Your Kong Gateway team