-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: timeout reached while waiting for sockets response #367
Comments
same error |
Getting this error. Any clue for fixes? |
I am having the same issue and I'm at a loss on how to stop it. Error: timeout reached while waiting for sockets response This is with: I've pretty much wrapped everything in try/catch blocks and .catch() where promises are involved. Really need a solution here. |
getting this error randomly |
Same error using ioredis |
This happened to me when the connection of the socket server loses connection to the redis server. We had it happen when our redis server went down and we tried to send things via redis |
Happening to me too. Using
|
Same problem when the number of clients is large. |
Same error here. Looking at the lib seems like the error is generated on this line: socket.io-redis-adapter/lib/index.ts Line 759 in ef5f0da
@darrachequesne Can you help us? What is the logic of this if that generates the error?
|
I am seeing this issue as well intermittently |
seems to happen when numSub and msgCount are off by 1
|
me too |
allSockets works for me, my app deployed on k8, on single instance it was fine, fetchsocket timeout on multiple instances |
anyone found a solution?? |
The timeout might happen if the requesting server does not receive enough responses from the other servers in the cluster. Catching the exception and retrying upon failure should account for those temporary issues: async function fetchSockets() {
for (let i = 0; i < MAX_RETRIES; i++) {
try {
return await io.in("room1").fetchSockets();
} catch (e) {
// timeout error
}
}
throw "too many retries";
} |
any better solution found? |
[email protected]
[email protected]
Calls made to the adapter methods as follows:
`
const sockets = await io.of('/').adapter.sockets();
console.log(sockets); // a Set containing all the connected socket ids
// this method is also exposed by the Server instance
const sockets = io.in('room3').allSockets();
console.log(sockets); // a Set containing the socket ids in 'room3'
`
Causes the below exception being thrown:
(node:20818) UnhandledPromiseRejectionWarning: Error: timeout reached while waiting for sockets response at Timeout._onTimeout (/var/app/node_modules/socket.io-redis/dist/index.js:286:28) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) (node:20818) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
The text was updated successfully, but these errors were encountered: