Improve Redis connection resilience for BullMQ job queue - #7775
Open
m-altaifi wants to merge 2 commits into
Open
Improve Redis connection resilience for BullMQ job queue#7775m-altaifi wants to merge 2 commits into
m-altaifi wants to merge 2 commits into
Conversation
Chocobozzz
reviewed
Sep 1, 2026
Chocobozzz
left a comment
Owner
There was a problem hiding this comment.
Can you target release/v8.3.x branch?
|
|
||
| this.flowProducer = new FlowProducer({ | ||
| connection: Redis.getRedisClientOptions('FlowProducer'), | ||
| connection: Redis.getRedisClientOptions('FlowProducer', { maxRetriesPerRequest: null, enableReadyCheck: false }), |
Owner
There was a problem hiding this comment.
Please wrap { maxRetriesPerRequest: null, enableReadyCheck: false } in an object to not repeat it across the file, and add a small comment explaining why we chose these options
Address review: hoist { maxRetriesPerRequest, enableReadyCheck } into a
single constant instead of repeating it, and document why these options
and the TCP keepalive are set.
m-altaifi
force-pushed
the
fix/job-queue-redis-resilience
branch
from
September 1, 2026 09:36
329c7a6 to
947dd97
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves Redis connection resilience for BullMQ workers and queues, addressing issues where idle TCP connections get dropped (causing
read ETIMEDOUT) and workers subsequently fail background lock renewal or stop processing jobs (e.g. #7774).Changes
keepAlive: 30000inRedis.getRedisClientOptions()to send periodic TCP keep-alive probes across Redis connections.maxRetriesPerRequest: nullandenableReadyCheck: falseto BullMQWorker,Queue,QueueEvents, andFlowProducerconnections as recommended by BullMQ to allow graceful reconnection and prevent worker command rejection during transient socket blips.Closes #7774