From b02f0a97b8969d4b67b0597376f4e789d54db6e5 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 10 May 2019 18:49:20 -0300 Subject: [PATCH] fix(healthchecks) run tcp active healthchecks in stream module Instead of disabling active healthchecks in the stream module altogether (which was done to avoid duplicate active healthchecks), what we need to do is to run the "tcp" type healthchecks in the stream module, and the other ones ("http", "https") in the http module. --- kong/runloop/balancer.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kong/runloop/balancer.lua b/kong/runloop/balancer.lua index 00ab5daf316..8fd6eca1917 100644 --- a/kong/runloop/balancer.lua +++ b/kong/runloop/balancer.lua @@ -300,12 +300,9 @@ do -- Do not run active healthchecks in `stream` module local checks = upstream.healthchecks - if ngx.config.subsystem == "stream" - and (checks.active.healthy.interval ~= 0 - or checks.active.unhealthy.interval ~= 0) + if (ngx.config.subsystem == "stream" and checks.active.type ~= "tcp") + or (ngx.config.subsystem == "http" and checks.active.type == "tcp") then - log(ngx.INFO, "[healthchecks] disabling active healthchecks in ", - "stream module") checks = pl_tablex.deepcopy(checks) checks.active.healthy.interval = 0 checks.active.unhealthy.interval = 0