Skip to content

io.fetchSockets() sometimes works across instances, sometimes not #557

Open

Description

@dizzyjaguar

I have an app where I need to send a list of all connected clients and rooms to all connected clients.
Sometimes I'm able to get all clients across multiple instances with io.fetchSockets() and other times it will only grab clients from the same instance.

I'm not exactly sure what to try at this point, but I'm almost certain this has to be the issue.

Here is related dependencies:

"@socket.io/redis-adapter": "^8.3.0",
"socket.io": "^4.8.1",
"socket.io-client": "^4.8.1"
"ioredis": "^5.5.0",

Activity

  1. vybhavpai-gush commented on May 20, 2026

    @vybhavpai-gush

    facing something similar, any solutions or planned fixes?

  2. dizzyjaguar commented on May 20, 2026

    @dizzyjaguar
    Author

    @vybhavpai-gush No, I changed my architecture so I'm just running one Websocket Server now. So I haven't been dealing with issue. (till I need to scale up)

  3. vybhavpai-gush commented on May 21, 2026

    @vybhavpai-gush

    really appreciate you getting back, thank you :) We are considering maintaining socket liveness via heart beat events being stored in redis per socket. not the cleanest solution, will post here if we find something else!

  4. vybhavpai-gush commented on May 22, 2026

    @vybhavpai-gush

    Hey @dizzyjaguar id like to know more about your implementation. We are running multiple EC2 instances which act as our chat servers and use redis adapter for establishing cross instance communication. message relaying works like a charm across but only fetch sockets doesnt work.
    interestingly(as every developer says) this works on my local
    I was suspecting this might have to do with AWS' setup and wanted to know what you have built

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions