Redis client has no socket timeouts, so a lost Redis connection stalls content requests for minutes

Aperta
#8,347 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, redis
Ambito
backend

Direzione di ricerca

Start with redis_connection.py, where the Redis client is built from REDIS_HOST and REDIS_PORT without socket timeouts, and check how REDIS_URL is parsed as an alternative path. Read the cache layer that falls back to the database when Redis raises an error, to confirm where the failure surfaces. Reproduce by pointing the client at an address that does not answer and timing a cache call. Done when the host-based client sets connect and socket timeouts and a health check, and the REDIS_URL options are documented.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue Triage-Needed

redis_connection.py builds the client with REDIS_HOST/REDIS_PORT and no socket_timeout, socket_connect_timeout, socket_keepalive or health_check_interval. Every content request consults the cache, and the cache serves the request without Redis when Redis raises an error. With no timeouts, nothing is raised when the Redis server disappears without closing its connections (node loss, network partition): a request on such a pooled connection waits until TCP gives up, which takes minutes, and new connections wait for the OS connect timeout.

Measured with redis-py 8.1 against an address that does not answer: a cache call fails after about 20 s without options and after about 4 s with socket_connect_timeout=1&socket_timeout=2 in REDIS_URL (three retries).

Suggestion: default timeouts and a health check when the client is built from REDIS_HOST, and documenting the REDIS_URL query options for deployments that set it.

Lingua principale
Python
Stelle
641
Fork
178
Merge medio
17h 36m
PR unite (30g)
76

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pulp/pulpcore

Tutte le issue di pulp/pulpcore

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.