AlinsRan opened a new pull request, #13758:
URL: https://github.com/apache/apisix/pull/13758
### 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:
```lua
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
- [x] I have explained the need for this PR and the problem it solves
- [x] 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
- [x] I have updated the documentation accordingly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]