Skip to content

fix(bullmq): disable temporarily#3841

Merged
icecrasher321 merged 1 commit intostagingfrom
fix/disable-bullmq
Mar 30, 2026
Merged

fix(bullmq): disable temporarily#3841
icecrasher321 merged 1 commit intostagingfrom
fix/disable-bullmq

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

Summary

Disable until memory issues with large number of execs are identified.

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 30, 2026 7:00am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 30, 2026

PR Summary

Medium Risk
Changes which async/dispatched execution paths use BullMQ vs the database backend, which can alter runtime behavior in production where REDIS_URL is set. Risk is mitigated by defaulting the new flag to false, effectively disabling BullMQ unless explicitly enabled.

Overview
BullMQ is now opt-in. isBullMQEnabled() requires both REDIS_URL and CONCURRENCY_CONTROL_ENABLED=true, preventing BullMQ from being selected just because Redis is configured.

Adds CONCURRENCY_CONTROL_ENABLED to env (default false), so call sites that choose the BullMQ backend (e.g., async job queue selection and dispatch helpers) will fall back to the non-BullMQ path unless the flag is explicitly enabled.

Written by Cursor Bugbot for commit 323c638. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR temporarily disables BullMQ-based concurrency control by introducing a new CONCURRENCY_CONTROL_ENABLED environment variable (defaulting to 'false') as a feature flag. The change gates isBullMQEnabled() on both this flag and the presence of REDIS_URL, so all existing callers (worker, webhook processor, schedule executor, knowledge sync engine, etc.) will transparently fall back to their inline/direct execution paths until the flag is explicitly set to 'true'.

Key changes:

  • apps/sim/lib/core/bullmq/connection.ts: isBullMQEnabled() now requires isTruthy(env.CONCURRENCY_CONTROL_ENABLED) && Boolean(env.REDIS_URL) instead of just Boolean(env.REDIS_URL).
  • apps/sim/lib/core/config/env.ts: CONCURRENCY_CONTROL_ENABLED added as z.string().optional().default('false') in the Admission & Burst Protection section.

The implementation is clean and correct — isTruthy('false') returns false (consistent with the existing utility semantics), and all ~10 call-sites of isBullMQEnabled() already have non-BullMQ fallback branches, so no callers are broken by this change.

Confidence Score: 5/5

Safe to merge — minimal, well-scoped change with no P0/P1 issues; all BullMQ call-sites already have fallback paths.

Both changed files are small and the logic is straightforward. isTruthy('false') correctly evaluates to false, so BullMQ is disabled by default. All ~10 consumers of isBullMQEnabled() already guard with if/else fallbacks, meaning no execution path is broken. No P1 or P0 findings were identified.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/core/bullmq/connection.ts Adds CONCURRENCY_CONTROL_ENABLED guard to isBullMQEnabled(), effectively disabling BullMQ by default while preserving re-enablement via env var.
apps/sim/lib/core/config/env.ts Adds CONCURRENCY_CONTROL_ENABLED env var (string, optional, default 'false') in the Admission & Burst Protection section.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[isBullMQEnabled call] --> B{CONCURRENCY_CONTROL_ENABLED\n== 'true' or '1'?}
    B -- No\n(default: 'false') --> C[Return false\nUse inline/direct execution]
    B -- Yes --> D{REDIS_URL set?}
    D -- No --> C
    D -- Yes --> E[Return true\nUse BullMQ queue]
    C --> F[Callers: worker, webhooks,\nschedules, knowledge sync]
    E --> F
Loading

Reviews (1): Last reviewed commit: "fix(bullmq): disable temporarily" | Re-trigger Greptile

@icecrasher321 icecrasher321 merged commit c4f4e6b into staging Mar 30, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/disable-bullmq branch March 31, 2026 04:29
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