Kong version ($ kong version)
2.5.0
Current Behaviour
When we create a service/route/upstream and then attach some targets to it.
on addition of any new target, all old earlier marked unhealthy targets automatically turns back healthy, when those are already deleted.
This cause a delayed in response and kong again marking them unhealthy.
we are using combination of active/passive health-check.
Expected Behaviour
The targets which are already marked as unhealthy should not be updated to healthy again unless they comes back or pass the health status.
Steps To Reproduce
Create a service with 3 fake targets and 1 active target(Service which can serve request). with below status check.
{
“healthchecks”: {
“active”: {
“https_verify_certificate”: false,
“healthy”: {
“successes”: 2,
“http_statuses”: [
200,
301,
302,
404,
201,
204,
401,
403
],
“interval”: 0
},
“unhealthy”: {
“interval”: 5,
“http_statuses”: [
429,
500,
501,
502,
503,
504,
505
],
“tcp_failures”: 5,
“timeouts”: 5,
“http_failures”: 5
},
“https_sni”: null,
“timeout”: 15,
“type”: “http”,
“http_path”: “/status”,
“concurrency”: 10
},
“passive”: {
“healthy”: {
“http_statuses”: [
200,
201,
202,
203,
204,
205,
206,
207,
208,
226,
300,
301,
302,
303,
304,
305,
306,
307,
308,
401,
403
],
“successes”: 2
},
“unhealthy”: {
“http_statuses”: [
404,
429,
500,
501,
502,
503,
504
],
“tcp_failures”: 1,
“timeouts”: 1,
“http_failures”: 1
},
“type”: “http”
},
“threshold”: 0
}
}
After you sends a lot of request you see the 3 fake targets will be marked unhealthy.
Now just add a new target and you will see all 5 targets will become healthy again.
Expected behaviour is: Only the last active target and new target should be in healthy state. Not the ones which were earlier marked unhealthy.