From dc0064a91d6012977a211ecf6c8161da4ecba46a Mon Sep 17 00:00:00 2001 From: AlinsRan Date: Wed, 29 Jul 2026 21:28:11 +0800 Subject: [PATCH] fix(xds): do not log 'no keys' as an error when an xds key has no data _automatic_fetch logged every non-nil error from sync_data, including the "no keys" sentinel that config.new returns when an xds key simply has no data yet. The periodic fetch loop already treats "no keys" as non-error (err ~= "no keys"); this makes _automatic_fetch consistent, so a config provider watching an empty xds key no longer spams error.log at startup. Signed-off-by: AlinsRan --- apisix/core/config_xds.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apisix/core/config_xds.lua b/apisix/core/config_xds.lua index bdb45206a917..21aacee2ecd8 100644 --- a/apisix/core/config_xds.lua +++ b/apisix/core/config_xds.lua @@ -329,7 +329,9 @@ function _M.new(key, opts) err = ok2 end - if err then + -- "no keys" means the xds key has no data yet, not a failure; the + -- periodic fetch loop above already treats it as non-error + if err and err ~= "no keys" then log.error("failed to fetch data from xds ", err, ", ", key) end