Cluster.Join fails when called asynchronically when SerializeAllMessages is set (#4488)

* Serializer failed to serialize CurrentClusterState when SerializeAllMessages was set.

* Serializer failed to serialize CurrentClusterState when SerializeAllMessages was set.

* Use defensive coding to prevent exception from being thrown from duplicate key insertion (#4489)

* Revert serialization to prefer INoSerializationVerificationNeeded instead.

* Update API approval list

Co-authored-by: Aaron Stannard <aaron@petabridge.com>
This commit is contained in:
Gregorius Soedharmo 2020-06-27 00:02:24 +07:00 коммит произвёл GitHub
Родитель c42a309065
Коммит 5c19ec833b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -68,7 +68,7 @@ namespace Akka.Cluster
public static readonly Akka.Cluster.ClusterEvent.IClusterDomainEvent Instance;
public override string ToString() { }
}
public sealed class CurrentClusterState
public sealed class CurrentClusterState : Akka.Actor.INoSerializationVerificationNeeded
{
public CurrentClusterState() { }
public CurrentClusterState(System.Collections.Immutable.ImmutableSortedSet<Akka.Cluster.Member> members, System.Collections.Immutable.ImmutableHashSet<Akka.Cluster.Member> unreachable, System.Collections.Immutable.ImmutableHashSet<Akka.Actor.Address> seenBy, Akka.Actor.Address leader, System.Collections.Immutable.ImmutableDictionary<string, Akka.Actor.Address> roleLeaderMap) { }

Просмотреть файл

@ -35,6 +35,7 @@ namespace Akka.Cluster.Tests
publish-stats-interval = 0 s # always, when it happens
run-coordinated-shutdown-when-down = off
}
akka.actor.serialize-messages = on
akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
akka.coordinated-shutdown.terminate-actor-system = off
akka.coordinated-shutdown.run-by-actor-system-terminate = off

Просмотреть файл

@ -14,6 +14,7 @@ using Akka.Actor;
using Akka.Dispatch;
using Akka.Event;
using Akka.Util.Internal;
using Newtonsoft.Json;
namespace Akka.Cluster
{
@ -67,7 +68,7 @@ namespace Akka.Cluster
/// <summary>
/// A snapshot of the current state of the <see cref="Cluster"/>
/// </summary>
public sealed class CurrentClusterState
public sealed class CurrentClusterState : INoSerializationVerificationNeeded
{
private readonly ImmutableSortedSet<Member> _members;
private readonly ImmutableHashSet<Member> _unreachable;