Skip to content

Commit

Permalink
fix(clustering): disable privileged for inc sync
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 7, 2024
1 parent 713908f commit f7c04a0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions kong/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,21 @@ function _GLOBAL.init_worker_events(kong_config)
"negative impact on Kong's response latency and memory usage")
end

local enable_privileged_agent = false
if kong_config.dedicated_config_processing and
kong_config.role == "data_plane" and
not kong.sync -- for incremental sync there is no privileged_agent
then
enable_privileged_agent = true
end

opts = {
unique_timeout = 5, -- life time of unique event data in lrucache
broker_id = 0, -- broker server runs in nginx worker #0
listening = listening, -- unix socket for broker listening
max_queue_len = 1024 * 50, -- max queue len for events buffering
max_payload_len = max_payload_len, -- max payload size in bytes
enable_privileged_agent = kong_config.dedicated_config_processing
and kong_config.role == "data_plane"
or false,
enable_privileged_agent = enable_privileged_agent,
}

worker_events = require "resty.events.compat"
Expand Down

0 comments on commit f7c04a0

Please sign in to comment.