Skip to content

fix: hand every delivered XREADGROUP entry to a Fiber - #2

Merged
webpatser merged 1 commit into
mainfrom
fix/xreadgroup-prefetch
Aug 28, 2026
Merged

webpatser merged 1 commit into
mainfrom
fix/xreadgroup-prefetch

Conversation

@webpatser

Copy link
Copy Markdown
Owner

Summary

  • XREADGROUP ... COUNT 1 STREAMS a b c returns up to one entry per stream; parseXreadgroupResponse() only returned the first stream's entry, so the others were delivered (PEL) but never processed until retry_after let another worker steal them.
  • Every entry is now parsed; the extras go into a per-worker prefetch buffer that readNextMessage() drains before the next read. Same path for the periodic own-PEL read.
  • Observed on scrpr 2026-08-28: slowSync Persist parts waited 30 min each while default was busy, throughput on the RDW sync collapsed to bursts.

Test plan

  • tests/Unit/Worker/WorkerPrefetchTest.php (4 cases: buffering, skipping payload-less entries, empty reply, buffer served before Redis)
  • full suite: 492 passed, 8 skipped

🤖 Generated with Claude Code

https://claude.ai/code/session_014vbDzqsY85c7hEPRSxM3XK

…irst stream's

Redis returns up to COUNT entries per stream for a multi-stream XREADGROUP.
The parser kept the first stream's entry and dropped the rest on the floor,
leaving them delivered-but-unprocessed in the consumer's PEL until
retry_after allowed a steal. Buffer the extra entries per worker and serve
them before the next read.
@webpatser
webpatser merged commit 459937e into main Aug 28, 2026
1 check passed
@webpatser
webpatser deleted the fix/xreadgroup-prefetch branch August 30, 2026 06:32
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