Initial UnknownHostException is Unrecoverable
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- java
- Área
- networking
Línea de trabajo
Empieza por el constructor de RawSocketSender y su método connect(), especialmente por cómo se almacena y reutiliza la dirección del servidor. Verifica el comportamiento cuando falla la resolución inicial del nombre de host y cuando DNS cambia durante el failover; se considera terminado cuando la reconexión utiliza la resolución actual del nombre de host en lugar de una dirección resuelta antigua.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The RawSocketSender takes a host and port in its constructor and coverts these into an InetSocketAddress, which tries to resolve the hostname. On RawSocketSender connect this InetSocketAddress is used to reconnect, but if it wasn't resolved during fluent-logger init then it will fail over and over. The code snipped from RawSocketSender is below:
public RawSocketSender(String host, int port, int timeout, int bufferCapacity, Reconnector reconnector) {
msgpack = new MessagePack();
msgpack.register(Event.class, Event.EventTemplate.INSTANCE);
pendings = ByteBuffer.allocate(bufferCapacity);
server = new InetSocketAddress(host, port); // Create InetSocketAddress on init
this.reconnector = reconnector;
name = String.format("%s_%d_%d_%d", host, port, timeout, bufferCapacity);
this.timeout = timeout;
}
private void connect() throws IOException {
try {
socket = new Socket();
socket.connect(server, timeout); // Reconnection uses pre-resolved server field
out = new BufferedOutputStream(socket.getOutputStream());
} catch (IOException e) {
throw e;
}
}
This issue comes up when using the fluent-logger in a highly dynamic environment (like on Docker Swarm) where apps may come up before a DNS entry in Consul is even resolvable. It also means that during failover of a Fluent host (triggering a DNS change) the then failing socket connection will always try the old Fluent host IP and never re-resolve the DNS entry.
My recommendation is to store the Fluent host and port as private fields within the RawSocketSender, not a resolved InetSocketAddress (now stored as this.server) and create a new InetSocketAddress on every socket connection.
I understand there will be performance implications of this and am happy to submit a PR, but wanted to bring it up in an issue in case there were reasons for implementing the RawSocketSender the current way.
- Lenguaje dominante
- Java
- Estrellas
- 210
- Forks
- 86
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fluent/fluent-logger-java
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
fluent/fluent-logger-java#100 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
fluent/fluent-logger-java#99 · 1 comentario · 2 reacciones ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
fluent/fluent-logger-java#98 · 1 comentario ·
-
Null Pointer Exception with slf4j-log4j12-1.7.30 (Fluent-logger incompatible with the new version) Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
fluent/fluent-logger-java#89 · 3 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
fluent/fluent-logger-java#88 · 1 comentario ·
Todos los issues de fluent/fluent-logger-java
Issues similares
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Abiertoarea/plugin
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
wso2/dpdp-accelerator#287 ·