hazelcast / hazelcast-csharp-client

Hazelcast .NET Client
https://hazelcast.com/clients/dotnet/
Apache License 2.0
102 stars 49 forks source link

Fix: Client shuts down on failover [API-2176] #864

Closed zpqrtbnk closed 9 months ago

zpqrtbnk commented 11 months ago

This PR fixes #863 and introduces the following changes:

The test FailoverTests2.TestClientCanFailoverWhenNoInitialMembershipEvent fails if executed without the above changes, and succeed with them. It connects the client to a first cluster, then stops that cluster, triggering failover to a second cluster that does not send members view events, thus triggering failover to a third cluster, which succeeds.

In addition, RetryStrategy was updated to ensure that the maximum cluster connection timeout does not exceed a value compatible with fitting it into a TimeSpan value and passing that value to a CancellationTokenSource - as some users (and one of our tests) may thing that long.MaxValue is safe to indicate "the longest timeout possible". We now simply and transparently trim their value to whatever is "the longest timeout we can support".

Changes to other files are cosmetic or there to improve testing and logging.

netlify[bot] commented 11 months ago

Deploy Preview for silly-valkyrie-e996d9 canceled.

Name Link
Latest commit 42036e5c89bc996757985940032607ef66a516e8
Latest deploy log https://app.netlify.com/sites/silly-valkyrie-e996d9/deploys/6565b2a3789b8a000764e326