Skip to content

P4DEVOPS-11504: pass redis_reconnect_attempts to API redis connection#701

Open
smahima27 wants to merge 2 commits intomainfrom
P4DEVOPS-11504-fix-api-redis-reconnect
Open

P4DEVOPS-11504: pass redis_reconnect_attempts to API redis connection#701
smahima27 wants to merge 2 commits intomainfrom
P4DEVOPS-11504-fix-api-redis-reconnect

Conversation

@smahima27
Copy link
Copy Markdown
Contributor

Problem

On startup, vmpooler-dev repeatedly hits Redis::CannotConnectError because the API thread creates its Redis connection without redis_reconnect_attempts:

# Before — uses default reconnect_attempts: 10 (10 immediate retries, no delay)
Vmpooler.new_redis(redis_host, redis_port, redis_password)

The manager thread correctly passed the configured value, which is the exponential-backoff array [0, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512]. The API did not, so its 10 instant retries exhausted before Redis was ready.

This only surfaces in dev because dev Redis has very limited resources (13m CPU / 96Mi memory) and takes longer to start, while prod Redis is already warm on restart.

Fix

Pass redis_reconnect_attempts to Vmpooler.new_redis in the API thread, consistent with the manager.

# After — uses configured exponential backoff
Vmpooler.new_redis(redis_host, redis_port, redis_password, redis_reconnect_attempts)

@smahima27 smahima27 requested a review from a team as a code owner May 5, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant