Description
Assume the SASL or SSL Connection is established successfully, but be reset when writing data into it (This will happen frequently in LVS Proxy environment )
Selecter poll will act like follows:
try {
...
//finish connect successfully
if (channel.finishConnect())
//the prepare will fail, for sasl or ssl will do handshake and write data
//throw exception
if (channel.isConnected() && !channel.ready())
channel.prepare();
....
} catch {
close(channel);
this.disconnected.add(channel.id()); (2)
}
The code line named (1) and (2) will mark the connection CONNECTED and DISCONNECTED at the same time.
And the NetworkClient poll will:
handleDisconnections(responses, updatedNow); //remove the channel
handleConnections(); //mark the channel CONNECTED
So get the inconsistent ConnectionStates, and such state will block the messages sent into this channel in Sender:
For the channel will never be ready and never be connected again:
public boolean ready(Node node, long now)
{ if (node.isEmpty()) throw new IllegalArgumentException("Cannot connect to empty node " + node); //return false, for the channel dose not exist actually if (isReady(node, now)) return true; //return false, for the channel is marked CONNECTED if (connectionStates.canConnect(node.idString(), now)) // if we are interested in sending to a node and we don't have a connection to it, initiate one initiateConnect(node, now); return false; }So all messages sent to such channel will be expired eventually
Attachments
Attachments
Issue Links
- links to