Question: Throttle Reconnect Attempts when kafka is unavailable

Abierto
#624 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
kafka, python

Línea de trabajo

The payload names the aiokafka transport and its reconnect.backoff.ms option, but no Faust file or test. Start by finding how Faust passes broker configuration to the aiokafka transport, then reproduce the reconnect loop by running a Faust app against a stopped Kafka broker. The issue asks a question rather than specifying a change, so first confirm with maintainers what behaviour is wanted before writing code.

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

Descripción

Checklist

  • I have included information about relevant versions
  • I have verified that the issue persists when using the master branch of Faust.

Steps to reproduce

Tell us what you did to cause something to happen.

  • Connect Faust App normally to a kafka broker
  • Kill kafka process

Expected behavior

The reconnect attempts aren't really unexpected. Is there a way to throttle the reconnect attempts or stop the logs from filling so rapidly? I can't find how to pass configuration to the aiokafka transport, which I think can accept reconnect.backoff.ms.

Actual behavior

The logs are spam with Errors very quickly. It looks like 100ms delay.

Full traceback

◠[2024-04-26 13:04:28,809] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◝[2024-04-26 13:04:28,811] [35601] [ERROR] Unable to update metadata from [1] 
◝[2024-04-26 13:04:28,852] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◞[2024-04-26 13:04:28,853] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◝[2024-04-26 13:04:28,869] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◞[2024-04-26 13:04:28,870] [35601] [ERROR] Unable to update metadata from [1] 
◞[2024-04-26 13:04:28,976] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◡[2024-04-26 13:04:28,977] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◞[2024-04-26 13:04:28,982] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◡[2024-04-26 13:04:28,983] [35601] [ERROR] Unable to update metadata from [1] 
◡[2024-04-26 13:04:29,089] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◟[2024-04-26 13:04:29,090] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◡[2024-04-26 13:04:29,098] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◟[2024-04-26 13:04:29,098] [35601] [ERROR] Unable to update metadata from [1] 
◟[2024-04-26 13:04:29,204] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◜[2024-04-26 13:04:29,204] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◟[2024-04-26 13:04:29,209] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◜[2024-04-26 13:04:29,210] [35601] [ERROR] Unable to update metadata from [1] 
◜[2024-04-26 13:04:29,316] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◠[2024-04-26 13:04:29,317] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◜[2024-04-26 13:04:29,327] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◠[2024-04-26 13:04:29,328] [35601] [ERROR] Unable to update metadata from [1] 
◝[2024-04-26 13:04:29,435] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◞[2024-04-26 13:04:29,436] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◝[2024-04-26 13:04:29,441] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◞[2024-04-26 13:04:29,441] [35601] [ERROR] Unable to update metadata from [1] 
◡[2024-04-26 13:04:29,546] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◟[2024-04-26 13:04:29,546] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◡[2024-04-26 13:04:29,551] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◟[2024-04-26 13:04:29,551] [35601] [ERROR] Unable to update metadata from [1] 
◟[2024-04-26 13:04:29,656] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◜[2024-04-26 13:04:29,656] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◟[2024-04-26 13:04:29,660] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◜[2024-04-26 13:04:29,661] [35601] [ERROR] Unable to update metadata from [1] 
◜[2024-04-26 13:04:29,766] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◠[2024-04-26 13:04:29,767] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◜[2024-04-26 13:04:29,776] [35601] [ERROR] Unable connect to node with id 1: KafkaConnectionError: Connection at localhost:9092 closed 
◠[2024-04-26 13:04:29,777] [35601] [ERROR] Unable to update metadata from [1] 
◡[2024-04-26 13:04:29,881] [35601] [ERROR] Unable connect to node with id 1: Multiple exceptions: [Errno 61] Connect call failed ('::1', 9092, 0, 0), [Errno 61] Connect call failed ('127.0.0.1', 9092) 
◟[2024-04-26 13:04:29,882] [35601] [ERROR] Group Coordinator Request failed: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1). 
◠[2024-04-26 13:04:29,887] [35601] [ERROR] Unable connect to node with id 1: Multiple exceptions: [Errno 61] Connect call failed ('::1', 9092, 0, 0), [Errno 61] Connect call failed ('127.0.0.1', 9092) ```

# Versions

* Python version Cython 3.11.8
* Faust version v0.11.0
* Operating system Darwin x86_64
* Kafka version 3.7.0
* RocksDB version (if applicable) 9.0.0

Lenguaje dominante
Python
Estrellas
1.9k
Forks
205
Merge medio
2 h 2 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de faust-streaming/faust

Todos los issues de faust-streaming/faust

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.