Skip to content

Commit

Permalink
fix(healthchecks) run tcp active healthchecks in stream module
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hishamhm committed May 16, 2019
1 parent 09420df commit b02f0a9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kong/runloop/balancer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b02f0a9

Please sign in to comment.