Skip to content

fix(xds): do not log 'no keys' as an error when an xds key has no data - #13758

Open
AlinsRan wants to merge 1 commit into
apache:masterfrom
AlinsRan:fix/xds-suppress-no-keys-error-log
Open

fix(xds): do not log 'no keys' as an error when an xds key has no data#13758
AlinsRan wants to merge 1 commit into
apache:masterfrom
AlinsRan:fix/xds-suppress-no-keys-error-log

Conversation

@AlinsRan

Copy link
Copy Markdown
Contributor

Description

_automatic_fetch logs every non-nil error returned by sync_data, including the "no keys" sentinel that config.new returns when an xds key simply has no data yet:

if err then
    log.error("failed to fetch data from xds ", err, ", ", key)
end

The periodic fetch loop a few lines up already treats "no keys" as non-error (err ~= "no keys"). This makes _automatic_fetch consistent with it, so a config provider watching an empty xds key no longer spams error.log at startup.

Which issue(s) this PR fixes

Removes spurious failed to fetch data from xds no keys error-log lines for xds keys that are legitimately empty.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change — this only changes whether an existing non-error condition is logged as an error; it mirrors the err ~= "no keys" filter the periodic loop already applies, and the xds test harness needs a preloaded .so, so there is no lightweight unit for the empty-key path
  • I have updated the documentation accordingly

_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 <alinsran@apache.org>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant