vercel / vercel/resumable-stream

Stale listener UUIDs cause Redis publish amplification after reconnects

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
574
Forks
44
Avg merge
3m
Merged PRs (30d)
1

Description

Each reconnect creates a new listener UUID and adds it to the producer’s listenerChannels array. When a consumer disconnects, it only unsubscribes from its Redis chunk channel; the producer is never told to remove that listener ID.

As a result, every future chunk is published to every listener ever registered during that stream, including disconnected listeners.

Example: if a user disconnects and reconnects five times, the producer may issue five PUBLISH commands per chunk even though only the latest listener is active. For 500 remaining chunks, that becomes 2,500 publishes instead of 500.

The producer should remove inactive listener IDs while preserving support for multiple genuinely active consumers.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the reconnect and disconnect handling around the producer’s listenerChannels array and Redis chunk-channel subscriptions. Reproduce the reconnect scenario described in the issue, then verify that inactive listener IDs are removed while multiple active consumers still receive each chunk without duplicate publishes.

Written by the indexing model from the issue text.

Assessment

Tech stack
redis, typescript
Domain
backend, distributed-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.