Skip to content

bugfix: warn instead of raising when beat_init fires with another scheduler - #343

Merged
sibson merged 1 commit into
sibson:mainfrom
HardMax71:fix/beat-init-warn-on-other-scheduler
Sep 10, 2026
Merged

sibson merged 1 commit into
sibson:mainfrom
HardMax71:fix/beat-init-warn-on-other-scheduler

Conversation

@HardMax71

Copy link
Copy Markdown
Contributor

Fixes #342

acquire_distributed_beat_lock reads sender.scheduler.lock_key. When redbeat is imported but celery beat runs without -S redbeat.RedBeatScheduler, the scheduler is Celery's PersistentScheduler, the receiver raises AttributeError: 'PersistentScheduler' object has no attribute 'lock_key', and Celery logs the traceback at startup. Beat then keeps running on the wrong scheduler, so the only hint that RedBeat is not in use is a confusing stack trace. #87 and #276 are both this misconfiguration and both ended with "pass --scheduler".

This returns early when the scheduler is not a RedBeatScheduler and logs a single warning that names the flag. Not a silent guard on purpose: the misconfiguration stays visible, just as one line instead of a traceback.

Test in tests/test_scheduler.py (RedBeatStartupWithAnotherScheduler), errors on main. CHANGES.txt entry under 2.4.3 (unreleased). make test 112 OK, make lint clean.

…eduler

The receiver is connected on import, so a beat started without
-S redbeat.RedBeatScheduler hit AttributeError on lock_key and kept
running on the wrong scheduler with only a traceback as the hint.
Return early with a warning that names the flag. Fixes #342.
Copilot AI lite review requested due to automatic review settings September 10, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T18:41:31.305004Z 08016d6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sibson

sibson commented Sep 10, 2026

Copy link
Copy Markdown
Owner

thanks, ✨ 🍰 ✨

@sibson
sibson merged commit 3959165 into sibson:main Sep 10, 2026
6 checks passed
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.

beat_init receiver raises AttributeError when beat runs another scheduler, instead of saying RedBeat is not in use

3 participants