Skip to content

Commit c400ef2

Browse files
chobitschronolaw
andauthored
fix(core): downgrade log level for routes rebuilding (#14458)
KAG-6944 --------- Co-authored-by: Chrono <chrono_cpp@me.com>
1 parent 3463e3b commit c400ef2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
message: Fixed an issue where the error logs generated during router rebuilding might be excessively noisy.
2+
type: bugfix
3+
scope: Core

kong/runloop/handler.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ local function new_router(version)
388388
end
389389

390390
if new_version ~= version then
391-
return nil, "router was changed while rebuilding it"
391+
log(INFO, "could not build router: router was changed while rebuilding it")
392+
return nil, nil
392393
end
393394
end
394395
counter = counter + 1
@@ -496,7 +497,7 @@ end
496497
local function get_updated_router()
497498
if kong.db.strategy ~= "off" and kong.configuration.worker_consistency == "strict" then
498499
local ok, err = rebuild_router(ROUTER_SYNC_OPTS)
499-
if not ok then
500+
if not ok and err then
500501
-- If an error happens while updating, log it and return non-updated
501502
-- version.
502503
log(ERR, "could not rebuild router: ", err, " (stale router will be used)")
@@ -1032,7 +1033,7 @@ return {
10321033
-- If the semaphore is locked, that means that the rebuild is
10331034
-- already ongoing.
10341035
local ok, err = rebuild_router(router_async_opts)
1035-
if not ok then
1036+
if not ok and err then
10361037
log(ERR, "could not rebuild router via timer: ", err)
10371038
end
10381039
end

0 commit comments

Comments
 (0)