Repository navigation
[release-0.33] Return NotFound to WatchList clients when a shard does not serve the resource - #4546
kcp-ci-bot wants to merge 1 commit into
Conversation
…resource A watch for a resource that is not served on this shard is answered with an empty watch that yields no events and stays open, so that a wildcard consumer aggregating across shards is not wedged by a shard that simply holds none of these objects. A WatchList client cannot use such a stream. It treats the watch as its initial list and waits for the server to close that list with an "initial-events-end" bookmark before it considers its store synced. An empty watch sends no such bookmark, and never errors either, so nothing makes the client relist — the comment's "objects that later appear on this shard are picked up on the next relist" never happens, because there is no next relist. The client waits forever: reflector.go:327: awaiting required bookmark event for initial events stream, no events received for 10.004121875s That is reachable in a normal deployment. A controller consuming an APIExport through its virtual workspace starts before any workspace has bound the export, so the endpoint slice is still empty; when the first binding appears, the controller connects and establishes a watch for a resource this shard does not serve yet. Its informers never sync and it never reconciles anything, with no error anywhere to explain it. Surface the NotFound to those clients instead: they retry, and pick the resource up once the shard serves it. Ordinary watches keep the empty watch and the behaviour that was added for them. An alternative would be for the empty watch to emit the initial-events-end bookmark itself, which would let a WatchList client sync against a shard that holds nothing. That needs a resourceVersion to report as synced-at, and I did not want to invent one; if there is a right value to use here, that is the better fix. Signed-off-by: Waldemar Kindler <waldemar.kindler@think-ahead.tech>
c1aacb9 to
e99a021
Compare
|
LGTM label has been added. DetailsGit tree hash: b6badb7b689eb9f5d06b5b8a073e9b43741f405b |
|
/kind bug |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis, ntnn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@kcp-ci-bot: The following tests failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@mjudeikis-bot this backport has issue. make a new pr with fixed unit tests and linting issues |
|
Opened #4547 with the fix: the test called |
This is an automated cherry-pick of #4384
/assign ntnn