Aleksandr Polovtcev created IGNITE-15988:
--------------------------------------------

             Summary: ConnectionManager can violate the message ordering 
contract
                 Key: IGNITE-15988
                 URL: https://issues.apache.org/jira/browse/IGNITE-15988
             Project: Ignite
          Issue Type: Bug
            Reporter: Aleksandr Polovtcev


{{MessagingService#send}} method defines the following contract:

# Messages will be delivered in the same order as they were sent
# If a message N has been successfully delivered to a member implies that all 
messages preceding N have also been successfully delivered.

However, the current underlying implementation can violate this contract in a 
specific case. This can happen due to the following code in the 
{{ConnectionManager#channel}} method:


{code:java}
if (consistentId != null) {
    // If consistent id is known, try looking up a channel by consistent id. 
There can be an outbound connection
    // or an inbound connection associated with that consistent id.
    NettySender channel = channels.compute(
            consistentId,
            (addr, sender) -> (sender == null || !sender.isOpen()) ? null : 
sender
    );
    ...
}

// Get an existing client or create a new one. NettyClient provides a 
CompletableFuture that resolves
// when the client is ready for write operations, so previously started client, 
that didn't establish connection
// or didn't perform the handhsake operaton, can be reused.
NettyClient client = clients.compute(address, (addr, existingClient) ->
        existingClient != null && !existingClient.failedToConnect() && 
!existingClient.isDisconnected()
                ? existingClient : connect(addr)
);
{code}




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to