Ignition Start - Timeout if connection is unsuccessful

classic Classic list List threaded Threaded
2 messages Options
Mahesh Renduchintala Mahesh Renduchintala
Reply | Threaded
Open this post in threaded view
|

Ignition Start - Timeout if connection is unsuccessful

Hello 
We are currently using Ignition.Start to get the handle for thick client. 
>> ignite = Ignition.start(cfg);
As I understand, this API is a blocking API, unless the connection is successfully established. 

However, in some scenarios, where the thick client is unable to connect properly, it is preferable to have a timeout option as specified below. 
>> ignite = Ignition.start(cfg,  timeout);

is this already available today? If not, can you take it as an enhancement request for 2.8. 

The reason why I ask is, in some scenarios, when a thick client comes up for the very first time, we see thick client making an attempt to connect to ignite servers almost in an infinite loop. 
Previously, I raised this infinite loop connecting issue before. 

regards
mahesh




Denis Mekhanikov Denis Mekhanikov
Reply | Threaded
Open this post in threaded view
|

Re: Ignition Start - Timeout if connection is unsuccessful

Mahesh,

There is a TcpDiscoverySpi property, that defines this behaviour:
TcpDiscoverySpi#joinTimeout [1]. So, instead of calling
Ignition.start() with a special property, you can specify this timeout
in the configuration.
If a join attempt is failed and joinTimeout is already exceeded, then
the client will stop trying.
Note, that this timeout is not strict, and the connection may take
longer before it fails in case if TcpDiscoverySpi#reconnectDelay [2]
is set or each connection attempt takes a long time.

[1] https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.html#setJoinTimeout-long-
[2] https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.html#setReconnectDelay-int-

Denis

ср, 11 сент. 2019 г. в 09:30, Mahesh Renduchintala
<[hidden email]>:

>
> Hello
>
> We are currently using Ignition.Start to get the handle for thick client.
>
> >> ignite = Ignition.start(cfg);
>
> As I understand, this API is a blocking API, unless the connection is successfully established.
>
> However, in some scenarios, where the thick client is unable to connect properly, it is preferable to have a timeout option as specified below.
> >> ignite = Ignition.start(cfg,  timeout);
>
> is this already available today? If not, can you take it as an enhancement request for 2.8.
>
> The reason why I ask is, in some scenarios, when a thick client comes up for the very first time, we see thick client making an attempt to connect to ignite servers almost in an infinite loop.
> Previously, I raised this infinite loop connecting issue before.
> http://apache-ignite-users.70518.x6.nabble.com/client-reconnect-working-td28570.html
>
> regards
> mahesh
>
>
>
>