You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by barrettbnr <ba...@bossanova.com> on 2016/08/04 13:11:09 UTC

Client Reconnect Lifecycle with Continuous Queries

I'm trying to understand the lifecycle of reconnecting

I have created a gist with testcase and some logging output

https://gist.github.com/bearrito/a2aed9e3e8e06799d3f5b27fc997aaa6

My question is why does the client still receive the cache put event even
after it has been disconnected and then receives the reconnect event ?

This is evidenced by the line that says: GOT POST-RECONNECT:
98cb5181-f06a-4f29-8683-a2fb4429b8be

From the documentation it seems that I should not have to get a new cache
instance, but rather should be able to use, the previous cache instance? It
also seems like my previous continuous query should not have continued
working.

Is there a difference between a network disconnect and reconnecting after
the grid node has called closed?

I'm mainly interested in answering how to reconnect my continuous queries
after I've received a CLIENT_NODE_RECONNECTED event.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Client-Reconnect-Lifecycle-with-Continuous-Queries-tp6763.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Client Reconnect Lifecycle with Continuous Queries

Posted by Barrett Strausser <ba...@bossanova.com>.
I believe I have encountered this
https://issues.apache.org/jira/browse/IGNITE-2766

My workaround was to in my client side code register a client side handler
for the CLIENT_DISCONNECTED event. When that occurs I attempt to close the
cursor, handling exceptions thrown, get a NEW handle on the cache and
re-register my queries.

It's ugly to do this because you can't just pass in a cache proxy instance
to a client but must provide some sort of factory and also build the
facility to re-register queries.

It seems to work though.

-b

On Wed, Aug 10, 2016 at 1:49 PM, Nikolai Tikhonov <nt...@apache.org>
wrote:

> Hi,
>
> In your case, a client node will deploy CQ query on new nodes which will
> join to topology. Until you don't stop CQ (invoke close() method) or node
> (which started CQ) stays in topology you will getting events.
>
> On Thu, Aug 4, 2016 at 4:11 PM, barrettbnr <ba...@bossanova.com> wrote:
>
>> I'm trying to understand the lifecycle of reconnecting
>>
>> I have created a gist with testcase and some logging output
>>
>> https://gist.github.com/bearrito/a2aed9e3e8e06799d3f5b27fc997aaa6
>>
>> My question is why does the client still receive the cache put event even
>> after it has been disconnected and then receives the reconnect event ?
>>
>> This is evidenced by the line that says: GOT POST-RECONNECT:
>> 98cb5181-f06a-4f29-8683-a2fb4429b8be
>>
>> From the documentation it seems that I should not have to get a new cache
>> instance, but rather should be able to use, the previous cache instance?
>> It
>> also seems like my previous continuous query should not have continued
>> working.
>>
>> Is there a difference between a network disconnect and reconnecting after
>> the grid node has called closed?
>>
>> I'm mainly interested in answering how to reconnect my continuous queries
>> after I've received a CLIENT_NODE_RECONNECTED event.
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Client-Reconnect-Lifecycle-with-Continuous-
>> Queries-tp6763.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>

Re: Client Reconnect Lifecycle with Continuous Queries

Posted by Nikolai Tikhonov <nt...@apache.org>.
Hi,

In your case, a client node will deploy CQ query on new nodes which will
join to topology. Until you don't stop CQ (invoke close() method) or node
(which started CQ) stays in topology you will getting events.

On Thu, Aug 4, 2016 at 4:11 PM, barrettbnr <ba...@bossanova.com> wrote:

> I'm trying to understand the lifecycle of reconnecting
>
> I have created a gist with testcase and some logging output
>
> https://gist.github.com/bearrito/a2aed9e3e8e06799d3f5b27fc997aaa6
>
> My question is why does the client still receive the cache put event even
> after it has been disconnected and then receives the reconnect event ?
>
> This is evidenced by the line that says: GOT POST-RECONNECT:
> 98cb5181-f06a-4f29-8683-a2fb4429b8be
>
> From the documentation it seems that I should not have to get a new cache
> instance, but rather should be able to use, the previous cache instance? It
> also seems like my previous continuous query should not have continued
> working.
>
> Is there a difference between a network disconnect and reconnecting after
> the grid node has called closed?
>
> I'm mainly interested in answering how to reconnect my continuous queries
> after I've received a CLIENT_NODE_RECONNECTED event.
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Client-Reconnect-Lifecycle-with-
> Continuous-Queries-tp6763.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>