fix: support Redis Cluster for BullMQ jobs#7960
Conversation
…to fix/investigate-bullmq-issue # Conflicts: # docs/development/technical-handbook/background-job-processing.mdx
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR updates the BullMQ jobs queue Redis key prefix from a plain string 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



What does this PR do?
Fixes the BullMQ response pipeline enqueue failure on Redis Cluster.
Staging Redis runs as a Redis Cluster, and BullMQ uses Lua scripts that touch multiple queue keys in one operation. With the old prefix (
formbricks:jobs), BullMQ keys could land in different Redis hash slots, causingCROSSSLOT Keys in request don't hash to the same slotwhenenqueueResponsePipelineJobtried to add a job.This PR updates the shared BullMQ jobs prefix to
{formbricks:jobs}so Redis Cluster hashes all queue keys to the same slot. It also adds a regression test and documents the prefix requirement in the background job handbook.Fixes #(issue)
How should this be tested?
pnpm --filter @formbricks/jobs testpnpm --filter @formbricks/logger buildpnpm --filter @formbricks/jobs buildCROSSSLOTerror.Checklist
Required
pnpm buildconsole.logsgit pull origin mainAppreciated