Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

IDIEP-82
Author Pavel Tupitsyn 
Sponsor Pavel Tupitsyn 
Created

 

Status
Status
colourGrey
titleDRAFT


Table of Contents

Motivation

// Define the problem to be solved.

Description

...

Users should be able to control thin client retry behavior in case of connection loss.

Description

  • Automatic reconnect on failure is present in all thin clients (see Thin clients features).
  • Java thin client also implements automatic operation retry. For example, if a cache.put() fails due to a connection issue, Ignite will try to establish a new connection (or use an existing one to another server), and execute cache.put() again. This behavior is dangerous for non-idempotent operations. In a case when the server completes an operation, but the connection fails during the response, the client will still retry the operation. For example, an SQL query that increments a column by 1 can be executed two or more times, leading to unexpected results.
  • Non-Java thin clients do not include automatic operation retry, so the users have to implement it like this:
Code Block
languagec#
titleUser-implemented retry logic
while (maxRetries-- > 0)
{
    try
    {
        cache.Put(1, "Hello");
        break;
    }
    catch (Exception e) when (e.GetBaseException() is SocketException)
    {
        // Retry.
    }
}

Risks and Assumptions

// Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.

...