SocketCluster / SocketCluster/socketcluster

BrokerError: Failed to unsubscribe socket

Open
#478 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6.2k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

A week ago we have updated our socket cluster and its different components.
After that we have received messages from our users saying they can't always see each others online state.
In the server logs we are seeing the following warnings:

[Warning] BrokerError: Failed to unsubscribe socket from the user-307911 channel - Socket Pq2b-USfU8tH2KnmAAtl tried to unsubscribe from a channel which it is not subscribed to at SCServerSocket.<anonymous> (/usr/src/node_modules/socketcluster-server/scserver.js:464:15) at SCServerSocket.Emitter.emit (/usr/src/node_modules/socketcluster-server/node_modules/component-emitter/index.js:133:20) at /usr/src/node_modules/socketcluster-server/scserversocket.js:165:38 at SCServer._passThroughMiddleware (/usr/src/node_modules/socketcluster-server/scserver.js:801:7) at SCServer.verifyInboundEvent (/usr/src/node_modules/socketcluster-server/scserver.js:695:8) at SCServerSocket._handleEventObject (/usr/src/node_modules/socketcluster-server/scserversocket.js:149:19) at WebSocket.<anonymous> (/usr/src/node_modules/socketcluster-server/scserversocket.js:118:14) at emitOne (events.js:116:13) at WebSocket.emit (events.js:211:7) at Receiver.receiverOnMessage (/usr/src/node_modules/socketcluster-server/node_modules/ws/lib/websocket.js:741:20)

Would you say these warnings are related to the problems our users are experiencing?
What would be a possible solution?
We are also seeing several socket hung up and pong timeout warnings.
Are those also a relation to the problem?

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

Start with the reported BrokerError stack trace, especially socketcluster-server/scserver.js:464 and scserversocket.js:165, and compare it with the socket hung up and pong timeout warnings. Determine whether these warnings explain the lost online-state updates and identify a reproducible scope and expected behavior before proposing a fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.