Skip to content

Bugfix: reject WatchList on the offline path so clients fall back - #2745

Open
Rad710 wants to merge 1 commit into
openyurtio:masterfrom
Rad710:fix-watchlist-fallback-offline
Open

Bugfix: reject WatchList on the offline path so clients fall back#2745
Rad710 wants to merge 1 commit into
openyurtio:masterfrom
Rad710:fix-watchlist-fallback-offline

Conversation

@Rad710

@Rad710 Rad710 commented Aug 11, 2026

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

While the cloud is unreachable, LocalProxy.localWatch answered a WatchList request (sendInitialEvents=true) with a 200, but this offline watch has no events and never emits the synthetic k8s.io/initial-events-end bookmark 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 (sendInitialEvents absent 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 a sendInitialEvents=false request is unaffected.

Does this PR introduce a user-facing change?

Reject WatchList (sendInitialEvents) requests on yurthub's offline path so client-go falls back to LIST+WATCH instead of hanging.

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>
@Rad710
Rad710 requested a review from a team as a code owner August 11, 2026 19:19
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant