grpc / grpc/grpc-java

xDS ADS reconnection should not spam logs

Offen
#8,886 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
bug xds
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

As recently seen:

```
WARNING: [Channel<11>: (xds:///)] Failed to resolve name. status=Status{​​code=UNAVAILABLE, description=Closed by server, cause=null}
```

This is being logged from ManagedChannelImpl:
https://github.com/grpc/grpc-java/blob/7308d920346e2e1cae640ed1f7e4dfad1b032df8/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java#L1891-L1893

I'm surprised that log statement exists as a WARNING. Seems it was introduced in the large ManagedChannelImpl2 rewrite (#2530).

There's two cases this WARNING could happen:
1. Before resolution has ever succeeded. There's no need for logging because the error will be communicated to RPCs. This is unlikely the case here just because "Closed by server" is probably the cycling of long-lived RPCs for load balancing
2. After initial resolution. This might deserve logs at some points because RPCs probably won't fail (gRPC will continue using previous data). In this case, xds client should probably squelch this "error" as it is quite normal. There could be some debate here as to whether the watchers would be notified, or whether it matters if they are notified, but overall this is quite ordinary. Any error here should be logged if re-creating the ADS stream fails (which is probably dependent on whether the stream received responses).

So that means we should make two changes (one to ManagedChannelImpl, one to xds).

I'd hope we'd never log WARNINGs like this, but it is a bit hard of a situation and I don't want us to let perfect be the enemy of good. At least for xDS, we should be able to avoid logging except when ADS stream creation fails.

I've seen #8773, but it looks incomplete, as it'd need to handle the "never received a response" case.

CC @erikjoh, @dapengzhang0, @YifeiZhuang, @sergiitk

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne bei ManagedChannelImpl.java rund um die verknüpfte Warnung und untersuche die im Issue und in #8773 behandelte Handhabung des xDS-Clients. Verfolge die Fälle vor und nach der ersten Antwort und überprüfe anschließend, dass gewöhnliche ADS-Zyklen still bleiben, während Fehler bei der Erstellung des ADS-Streams weiterhin protokolliert werden, einschließlich des Falls, dass nie eine Antwort empfangen wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
distributed-systems, networking
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.