Add Redix connection resilience options to Exq config

Configures Redix (Exq's Redis client) with better connection handling:
- sync_connect: true - fail fast if Redis unavailable at startup
- exit_on_disconnection: false - don't crash process on disconnect
- backoff_initial: 500ms, backoff_max: 30s - retry with exponential backoff

This helps Exq survive temporary Redis disconnections without crashing,
reducing the frequency of Protocol.UndefinedError crashes in Exq.Node.Server.
This commit is contained in:
Graham McIntire 2026-01-20 11:42:02 -06:00
parent 7f7cbac965
commit 795ab8a041
No known key found for this signature in database

View file

@ -72,12 +72,27 @@ defmodule Towerops.ExqSupervisor do
namespace: "exq",
concurrency: 10,
queues: ["default", "discovery", "polling", "monitoring", "maintenance"],
# Increase max retries and backoff for better Redis connection recovery
# Poll settings - how long to wait for Redis responses
poll_timeout: 50,
scheduler_poll_timeout: 200,
scheduler_enable: true,
# Job retry settings
max_retries: 50,
# Exponential backoff starting at 500ms
backoff: 500,
# Add shutdown timeout to allow jobs to complete
shutdown_timeout: 25_000
# Exponential backoff starting at 500ms, up to 60s
mode: :default,
shutdown_timeout: 30_000,
# Redix connection options for better resilience
redis_options: [
# Synchronous connect to fail fast if Redis unavailable
sync_connect: true,
# Don't exit process on disconnection - let Exq handle it
exit_on_disconnection: false,
# Connection timeout
timeout: 5_000,
# Backoff for reconnection attempts
backoff_initial: 500,
backoff_max: 30_000
]
]
end
end