-
Notifications
You must be signed in to change notification settings - Fork 15
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: only 0 responses received out of 1" while scaling up a high-traffic system with multiple nodes. #6
Comments
I had a similar error when making a call to fetchSockets().
The other instances show an error My solution was to check for sockets following @darrachequesne's recommendation and not use fetchSockets. |
I've also been getting a similar error with timeout reached: only 3 responses received out of 7 |
I have the same problem in version 0.1.0 a lot of:
|
@hysapp @OnlySekai hello,sirs,do you resolve this bug? |
No, I implemented everything myself to be able to save and receive the list of online users, the stream adapter was not optimal at all and had bugs, and I used the sharded adapter. |
can you tell me ,how to do it ,dear sir. |
The ClusterAdapter class has been moved to [1], so that this adapter only needs to implement to pub/sub mechanism. Also, [2] should reduce the number of "timeout reached: only x responses received out of y" errors, since the fetchSockets() requests will now succeed even if a server leaves the cluster. [1]: https://github.com/socketio/socket.io-adapter [2]: socketio/socket.io-adapter@0e23ff0 Related: #6
socketio/socket.io-adapter@0e23ff0 (included in version @hysapp do you remember what kind of bugs you encountered? |
I think this is not a bug ,but nodejs's event loop is blocked. |
/data/geelevel-signaling/node_modules/socket.io-adapter/dist/cluster-adapter.js:600 Error: timeout reached: missing 1 responses Node.js v22.5.1 |
I try to used @socket.io/redis-adapter , not find this bug. only show in redis-streams-adapter. |
I encountered an error "Error: timeout reached: only 0 responses received out of 1" while scaling up a high-traffic system with multiple nodes.
My system run 2 same instances on digitalOceans, and sometime it had been crash with error:
/workspace/node_modules/@socket.io/redis-streams-adapter/dist/cluster-adapter.js:348 reject(new Error(
timeout reached: only ${storedRequest.current} responses received out of ${storedRequest.expected})); Error: timeout reached: only 0 responses received out of 1 at listOnTimeout (node:internal/timers:559:17) at processTimers (node:internal/timers:502:7)
my setup redis
`const redisClient = createClient({
url: config.REDIS_ADDRESS,
});
const initRedis = () => {
redisClient.on('error', err => console.log(err));
return redisClient.connect().then(() => console.log('connected redis success'));
};`
my setup adapter is:
Io.io = new Server(httpServer, { adapter: createAdapter(redisClient, { maxLen: 500_000, readCount: 5000, heartbeatInterval: 5_000, heartbeatTimeout: 120_000, }), cors: { origin: config.CORS_WEBSOCKET, }, connectionStateRecovery: { maxDisconnectionDuration: config.MAX_DISCONNECTION_DURATION, skipMiddlewares: true, }, }).use(checkTokenAuth);
my setup use witth express:
const server = http.createServer(app); const io = new Io(); Promise.all([db.init(), initRedis()]).then(async () => { server.listen(config.PORT, () => { logger.info(
HttpNetwork is running at port: ${config.PORT}); }); io.startSocket(server, () => console.log(
socket is running at port: ${config.PORT})); });
The text was updated successfully, but these errors were encountered: