Skip to content

fix: remove stale listener UUIDs on consumer disconnect - #49

Open
ShobhanKarthish wants to merge 1 commit into
vercel:mainfrom
ShobhanKarthish:fix/stale-listener-cleanup
Open

ShobhanKarthish wants to merge 1 commit into
vercel:mainfrom
ShobhanKarthish:fix/stale-listener-cleanup

Conversation

@ShobhanKarthish

Copy link
Copy Markdown

Summary

  • On consumer disconnect/cancel, notify the producer to remove that listenerId from listenerChannels.
  • Prevents Redis PUBLISH amplification when clients reconnect and accumulate stale listener UUIDs.
  • Preserves fan-out to multiple genuinely active consumers.
  • Adds reconnect regression coverage for stale-listener cleanup and multi-consumer behavior.

Test plan

  • In-memory suite (basic-in-memory.test.ts) including new reconnect/multi-consumer tests
  • Redis / ioredis suites when REDIS_URL is available

Closes #48

Notify the producer when a resumed consumer disconnects so its
listenerId is dropped from listenerChannels. This prevents Redis
PUBLISH amplification across reconnects while preserving fan-out to
multiple active consumers.

Closes vercel#48
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.

Stale listener UUIDs cause Redis publish amplification after reconnects

1 participant