matrix-org / matrix-org/matrix-python-sdk

JSONDecodeError when trying to interact with user in a non-healthy server

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

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
266
Forks
118
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

We got a small federation running for Raiden Network, and because of some disk full issue, one of the servers crashed. Following it, the healthy ones started returning some unexpected responses for interactions with users on the healthy ones.
E.g. trying to invite an user in the unhealthy server to a room in the healthy one, the invite request returned:

<Response [429]>
{"errcode":"M_UNKNOWN","error":"Unknown Status"}

but from
https://github.com/matrix-org/matrix-python-sdk/blob/e366d52850f2bd948e9613022b735054616cfe0b/matrix_client/api.py#L731-L735
if the error isn't a json, json.JSONDecodeError will be raised.
Quick fix is to add json.JSONDecodeError to the handled errors in L734
Full stack traces and context can be found in raiden-network/raiden#2603

Guía de contribución

Abrir la guía de contribución

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.

Línea de trabajo

Comienza en matrix_client/api.py, alrededor de las líneas 731–735, donde se analizan y gestionan las respuestas de error que no son JSON. Reproduce la respuesta 429 que contiene la carga útil de error mostrada y, a continuación, verifica que la interacción siga la ruta existente de errores gestionados sin lanzar JSONDecodeError.

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

Evaluación

Stack tecnológico
python
Área
api, backend
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.