Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fix(api): add a socket timeout and a health check to the durable Redis streams client

Aperta
#7,535 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@unfitcoder101 ci sta già lavorando.

Dal 14/10/2026.

  • #7587 di @unfitcoder101 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, redis

Direzione di ricerca

Start by reading api/oss/src/dbs/redis/shared/engine.py and api/entrypoints/worker_streams.py, focusing on Redis client creation and the consumer loops. Check how XREADGROUP blocking time relates to socket timeouts, then run the worker against a local Redis instance and stop Redis while it reads. Done means both clients recover after Redis returns and stream consumption resumes.

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

Descrizione

🤖 The AI agent says:

Problem

The durable Redis streams client has no socket timeout and no health check. When a managed Redis fails over to its standby, an open connection can stop answering without being closed. A call on that connection then waits forever. Retries don't help, because the call never returns. In that case the stream workers stop consuming spans, records and events, and they don't recover until the pod restarts.

The client is built in two places, and both are on release/v0.122.5:

  • api/oss/src/dbs/redis/shared/engine.py: StreamsEngine.get_redis() calls Redis.from_url(env.redis.uri_durable, decode_responses=False) with no socket_timeout.
  • api/entrypoints/worker_streams.py: the worker passes socket_timeout=None on purpose, because XREADGROUP blocks for 5 seconds and a shorter timeout would cut that call.

Fix

  1. Give both clients a socket timeout that is longer than the longest blocking read. For example, use 15 seconds when XREADGROUP blocks for 5 seconds.
  2. Set health_check_interval (for example 30 seconds) and socket_keepalive=True, so a dead connection is found and replaced.
  3. Make sure that the consumer loops catch ConnectionError and TimeoutError, reconnect, and continue.
  4. Test the fix by stopping a local Redis while a worker reads. Check that the worker reconnects after Redis comes back.

The failover window is short (about half a second when measured). Without a timeout, though, the hang lasts until someone restarts the pod.

Lingua principale
TypeScript
Stelle
4.8k
Fork
690
Merge medio
18h 33m
PR unite (30g)
424

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 Agenta-AI/agenta

Tutte le issue di Agenta-AI/agenta

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.