Bugfix: reject WatchList on the offline path so clients fall back - #2745
Open
Rad710 wants to merge 1 commit into
Open
Bugfix: reject WatchList on the offline path so clients fall back#2745Rad710 wants to merge 1 commit into
Rad710 wants to merge 1 commit into
Conversation
While the cloud is unreachable, LocalProxy.localWatch answered a WatchList request (sendInitialEvents=true) with 200 but never sends the initial-events-end bookmark, so client-go's reflector blocks forever and the informer never syncs. Return 400 before the header instead, so the client falls back to LIST+WATCH. The non-WatchList path is unchanged. Signed-off-by: Rolando Medina Rosner <rolmedro@gmail.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What type of PR is this?
/kind bug
What this PR does / why we need it:
While the cloud is unreachable,
LocalProxy.localWatchanswered a WatchList request (sendInitialEvents=true) with a 200, but this offline watch has no events and never emits the synthetick8s.io/initial-events-endbookmark that client-go waits for. client-go's reflector only logs the missing bookmark as a warning — it is never surfaced as an error — so the informer waits forever and never syncs (a permanent hang), rather than falling back.This returns a 400 before writing the 200 header. client-go treats any error that is not a 429 or a connection refusal as a signal to fall back to LIST+WATCH, which the local proxy can serve from the on-disk cache. The non-WatchList path (
sendInitialEventsabsent or false) is untouched.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Adds two cases to
local_test.go: a WatchList request must fail fast (asserted under a tight deadline) so the client can fall back, and asendInitialEvents=falserequest is unaffected.Does this PR introduce a user-facing change?