Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Scheduler] Recover pending RecurringMessages after consumer stops midway#64335

Merged
nicolas-grekas merged 1 commit into
symfony:6.4symfony/symfony:6.4from
ousamabenyounes:fix/issue-62496ousamabenyounes/symfony:fix/issue-62496Copy head branch name to clipboard
May 23, 2026
Merged

[Scheduler] Recover pending RecurringMessages after consumer stops midway#64335
nicolas-grekas merged 1 commit into
symfony:6.4symfony/symfony:6.4from
ousamabenyounes:fix/issue-62496ousamabenyounes/symfony:fix/issue-62496Copy head branch name to clipboard

Conversation

@ousamabenyounes
Copy link
Copy Markdown
Contributor

@ousamabenyounes ousamabenyounes commented May 22, 2026

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #62496
License MIT

When the consumer stops after yielding part of the messages due at one trigger time (e.g. messenger:consume --limit 1, SIGINT, fatal error), the next process rebuilt the heap with each trigger's run strictly after the checkpointed time, silently dropping the un-yielded messages at that time.

On the first heap build of a new instance with a non-warmup checkpoint, probe triggers one microsecond before $lastTime so they re-emit their entries due at $lastTime. The existing skip logic ($time == $lastTime && $index <= $lastIndex) then filters out already-yielded indices and lets the un-processed remainder through.

Reproduces with two RecurringMessage::every('30 seconds', …) consumed under --limit 1: "first" runs on every restart, "second" never runs without this patch.

TDD verification

  • RED (new test without prod fix):
F 1/1 (100%)

1) Symfony\Component\Scheduler\Tests\Generator\MessageGeneratorTest::testCheckpointWithMultipleRecurringMessagesAtSameTriggerTime
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
-Array &0 (
-    0 => stdClass Object &00000000000001be0000000000000000 (
-        'id' => 'second'
-    )
-)
+Array &0 ()

FAILURES! Tests: 1, Assertions: 3, Failures: 1.
  • GREEN (new test with prod fix): OK (1 test, 3 assertions)
  • Full MessageGeneratorTest: OK (18 tests, 81 assertions)
  • Full Scheduler suite: OK (144 tests, 773 assertions) — no regression.

@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @ousamabenyounes.

@nicolas-grekas nicolas-grekas merged commit c5b2053 into symfony:6.4 May 23, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.