I'm writing an application where it is important to be able to find out in real time whether a specific user (identified by a socket id) is currently connected to any machine inside the cluster or not...
However, this does not seem possible in the general case (an easy implementation would only work unreliably).
For example, lets say a two users are connected to two different servers A and B and chatting with one another (using socket.io redis adapter), and suddenly server A goes down. Further, for whatever reason, the user connected to server A fails to reconnect to server B. Server B has no (easy) way to tell that server A has gone down and that its users have been disconnected. The user connected to server B therefore will not know that his partner cannot get his messages.
Is there any strategy to help in this case? Maybe have the servers poll each other every few seconds to make sure they are alive? Implement some kind of heartbeat function to make sure users are alive (which would not be easy to implement at all in the general case)? Any clues as to how to proceed? Thanks!