Timeout Error When Using remoteJoin in a Different Namespace
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- redis, typescript
Direzione di ricerca
Reproduce the setup with the main and /bbb namespaces, Redis, and the remoteJoin calls described in the issue. Start at the remoteJoin implementation referenced by dist/index.js:417 and trace how namespace responses are handled. Done means remoteJoin completes for both namespaces without the timeout error, with coverage for this reproduction.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We're encountering a timeout error when attempting to use the remoteJoin function from the socket.io-redis adapter. The error occurs when a client initially connects to the default (main) namespace, and the server tries to have the client join a room in the /bbb namespace using remoteJoin.
server code
const io = SocketIOServer(port, {
allowEIO3: true,
cors: {
origin: [
'https://example.com'
],
methods: ['GET', 'POST'],
credentials: true
}
});
io.adapter(
redisAdapter('redis-url', {
auth_pass: 'redis-password',
requestsTimeout: 3000
})
);
io.on("connection", async socket => {
io.of("/").adapter.remoteJoin(socket.id, "room-1");
io.of("/bbb").adapter.remoteJoin(socket.id, "room-1");
});
client code
const socket = io();
server error log
2024-08-25T17:56:42.260288+00:00 app[web.1]: [3131] SOCKETIO join error
2024-08-25T17:56:42.260543+00:00 app[web.1]: Error: timeout reached while waiting for remoteJoin response
2024-08-25T17:56:42.260546+00:00 app[web.1]: at Timeout._onTimeout (/app/node_modules/socket.io-redis/dist/index.js:417:28)
2024-08-25T17:56:42.260555+00:00 app[web.1]: at listOnTimeout (node:internal/timers:557:17)
2024-08-25T17:56:42.260555+00:00 app[web.1]: at processTimers (node:internal/timers:500:7)
Steps to Reproduce
- Connect a client to the main namespace using const socket = io();.
- On the server side, use remoteJoin to join the client to a room in both the main (/) and /bbb namespaces.
- Observe the timeout error in the server logs.
Expected Behavior
The client should successfully join the specified room in both namespaces without encountering a timeout error.
Actual Behavior
The remoteJoin operation times out when attempting to join the room in the /bbb namespace.
Additional Information
We are using the socket.io-redis adapter with a Redis server.
The issue seems related to using remoteJoin across different namespaces.
- Lingua principale
- TypeScript
- Stelle
- 2.8k
- Fork
- 485
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di socketio/socket.io-redis-adapter
-
question
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
socketio/socket.io-redis-adapter#574 · 1 commento ·
-
io.fetchSockets() fails with createSentinelForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
socketio/socket.io-redis-adapter#573 · 1 commento ·
-
`hasBinary()` throws `RangeError: Maximum call stack size exceeded` on Mongoose documents, silently dropping events in sharded modeForse già presa @junsj119 l’ha presa 96 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
socketio/socket.io-redis-adapter#561 · 1 commento ·
Tutte le issue di socketio/socket.io-redis-adapter
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
g1331/phantom-circuit#93 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HerringtonDarkholme/hd-lang#1699 ·
I maintainer di solito rispondono entro 1 giorno
-
account bug communication lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno