You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
Glific is experiencing intermittent HTTP 520 errors (~5–6 times per day) on the POST /api/v1/llm/call endpoint. The issue likely arises from idle-timeout settings in the connection layer rather than application code, affecting overall reliability.
Update Dockerfile to add --timeout-keep-alive 180 to the uvicorn CMD.
Modify core/rate_monitor.py to include socket_timeout=1 and socket_connect_timeout=1 for the Redis client.
Raise ALB connection idle timeout to 120s.
Enable access logs to S3 for future diagnostics.
Original issue
Context
Glific intermittently receives HTTP 520s (~5–6/day) on POST /api/v1/llm/call across multiple orgs. App logs show healthy sub-second processing and complete job-enqueue traces for the affected windows — the failures probably happen at the connection layer (Cloudflare ↔ ALB ↔ uvicorn), not in application code. Low traffic (~1.2 req/min) means keepalive connections sit idle constantly, triggering the classic idle-timeout race with default settings.
changed the title [-]Intermittent Cloudflare 520s on Glific-facing endpoints — connection-layer hardening[/-][+]Glific: Fix HTTP 520 errors[/+]on Aug 20, 2026
With this 1sec socket_timeout if Redis is just slow (GC pause, network blip, connection pool exhaustion) rather than down, calls will time out and raise redis.exceptions.TimeoutError/ConnectionError . Need some more testing to check what should be the ideal number for our use case
Activity
[-]Intermittent Cloudflare 520s on Glific-facing endpoints — connection-layer hardening[/-][+]Glific: Fix HTTP 520 errors[/+]Prajna1999 commentedon Aug 28, 2026
With this 1sec socket_timeout if Redis is just slow (GC pause, network blip, connection pool exhaustion) rather than down, calls will time out and raise redis.exceptions.TimeoutError/ConnectionError . Need some more testing to check what should be the ideal number for our use case