matrix-org / matrix-org/matrix-python-sdk
429 responses w/o retry_after_ms cause exception
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
Sometimes (no idea how this is triggered) synapse sends responses with a 429 status code without the `retry_after_ms` field. In those cases, the python client crashes with a `KeyError` since https://github.com/matrix-org/matrix-python-sdk/blob/401439f020ba79197c719a9b2d51838d833b731e/matrix_client/api.py#L666 unconditionally expects `retry_after_ms` to be available on 429 responses.
A relatively simple solution would be to have our own internal exponential backoff counter that gets reset every time a request succeeds or an explicit `retry_after_ms` value is received.
What do you think?
Guía de contribución
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.
Línea de trabajo
Start at matrix_client/api.py around line 666 and inspect the 429 response handling. Done means a 429 response without retry_after_ms no longer raises KeyError, while the existing explicit retry_after_ms behavior and the proposed backoff behavior are addressed.
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
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100