kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-5417) Clients get inconsistent connection states when SASL/SSL connection is marked CONECTED and DISCONNECTED at the same time
Date Wed, 23 Aug 2017 13:51:00 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-5417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16138367#comment-16138367
] 

ASF GitHub Bot commented on KAFKA-5417:
---------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/kafka/pull/3282


> Clients get inconsistent connection states when SASL/SSL connection is marked CONECTED
and DISCONNECTED at the same time
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-5417
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5417
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.10.2.1
>            Reporter: dongeforever
>            Priority: Critical
>             Fix For: 0.10.2.2, 0.11.0.1
>
>
> 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()) {
>         this.connected.add(channel.id());    (1)
>      }
>      //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



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message