grpc / grpc/grpc-java

xDS ADS reconnection should not spam logs

Abierto
#8,886 2 comentarios 1 reacción 0 asignados Ver en GitHub
bug xds
Lenguaje dominante
Java
Estrellas
12.1k
Forks
4k
Merge medio
2 d 17 h
PR fusionados (30 d)
37

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en ManagedChannelImpl.java, alrededor de la advertencia enlazada, e inspecciona el manejo del cliente xDS tratado en el issue y en #8773. Sigue los casos anteriores y posteriores a la primera respuesta y, después, verifica que los ciclos normales de ADS sean silenciosos, mientras que los fallos de creación del flujo ADS sigan registrándose, incluido el caso en el que nunca se recibe una respuesta.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
distributed-systems, networking
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.