You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

IDIEP-82
Author Pavel Tupitsyn 
Sponsor Pavel Tupitsyn 
Created

 

StatusDRAFT


Motivation

Users should be able to control thin client retry behavior in case of connection loss. The API should be unified across all thin client implementations.

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:
User-implemented retry logic
while (maxRetries-- > 0)
{
    try
    {
        cache.Put(1, "Hello");
        break;
    }
    catch (Exception e) when (e.GetBaseException() is SocketException)
    {
        // Retry.
    }
}

Current State Summary

  • Java thin client has retry, but it can be dangerous and can't be fine tuned
  • Other thin client don't have retry and user has to write cumbersome code

Proposal

TODO: ClientRetryPolicy interface.


Risks and Assumptions

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

Discussion Links

// Links to discussions on the devlist, if applicable.

Reference Links

// Links to various reference documents, if applicable.

Tickets

// Links or report with relevant JIRA tickets.

  • No labels