diff --git a/src/Proto.Cluster/Member/MemberList.cs b/src/Proto.Cluster/Member/MemberList.cs index 98401bf5ce..1836f1e899 100644 --- a/src/Proto.Cluster/Member/MemberList.cs +++ b/src/Proto.Cluster/Member/MemberList.cs @@ -97,6 +97,11 @@ public MemberList(Cluster cluster) { SelfBlocked(); } + + //only log if the member is known to us + if (TryGetMember(b.MemberId, out _)) { + Logger.LogInformation("Blocking member {MemberId} due to {Reason}", b.MemberId, b.Reason); + } UpdateClusterTopology(_activeMembers.Members); }, Dispatchers.DefaultDispatcher diff --git a/src/Proto.Remote/BlockList.cs b/src/Proto.Remote/BlockList.cs index f4d9bbe5ec..20ab8dba0d 100644 --- a/src/Proto.Remote/BlockList.cs +++ b/src/Proto.Remote/BlockList.cs @@ -12,7 +12,7 @@ namespace Proto.Remote; -public record MemberBlocked(string MemberId); +public record MemberBlocked(string MemberId, string Reason); /// /// contains all members that have been blocked from communication, e.g. due to @@ -47,14 +47,13 @@ internal void Block(IEnumerable memberIds, string reason) foreach (var member in newIds) { - Logger.LogInformation("Blocking member {MemberId} due to {Reason}", member, reason); _blockedMembers = _blockedMembers.ContainsKey(member) switch { false => _blockedMembers.Add(member, DateTime.UtcNow), _ => _blockedMembers.SetItem(member, DateTime.UtcNow) }; - _system.EventStream.Publish(new MemberBlocked(member)); + _system.EventStream.Publish(new MemberBlocked(member, reason)); } } }