Skip to content

Commit 7ea7b1f

Browse files
committed
Cluster.Event
1 parent fdc7151 commit 7ea7b1f

9 files changed

+25
-1
lines changed

Sources/DistributedActors/Cluster/Cluster+Event.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ extension Cluster {
2424
case membershipChange(MembershipChange)
2525
case reachabilityChange(ReachabilityChange)
2626
case leadershipChange(LeadershipChange)
27+
case _PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE
2728
}
2829
}
2930

Sources/DistributedActors/Cluster/Cluster+Membership.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Distributed Actors open source project
44
//
5-
// Copyright (c) 2018-2019 Apple Inc. and the Swift Distributed Actors project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the Swift Distributed Actors project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -604,6 +604,9 @@ extension Cluster.Membership {
604604

605605
case .reachabilityChange(let change):
606606
_ = self.applyReachabilityChange(change)
607+
608+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
609+
() // do nothing
607610
}
608611
}
609612
}

Sources/DistributedActors/Cluster/ClusterShellState.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ extension ClusterShellState {
456456
changeWasApplied = changeWasApplied || directive.applied
457457
// actions we'll calculate below, once
458458
}
459+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
460+
self.log.error("Received Cluster.Event [\(event)]. This should not happen, please file an issue.")
461+
changeWasApplied = false
459462
}
460463

461464
guard changeWasApplied else {

Sources/DistributedActors/Cluster/DistributedNodeDeathWatcher.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ internal actor DistributedNodeDeathWatcher {
6666
}
6767
case .leadershipChange, .reachabilityChange:
6868
break // ignore those, they don't affect downing
69+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
70+
self.log.error("Received Cluster.Event [\(event)]. This should not happen, please file an issue.")
6971
}
7072
}
7173
}

Sources/DistributedActors/Cluster/Downing/TimeoutBasedDowningStrategy.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public final class TimeoutBasedDowningStrategy: DowningStrategy {
7474
} else {
7575
return self.onMemberReachable(change)
7676
}
77+
78+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
79+
return .none // do nothing
7780
}
7881
}
7982

Sources/DistributedActors/Cluster/Leadership.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ extension Leadership {
141141

142142
case .leadershipChange:
143143
return .same // we are the source of such events!
144+
145+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
146+
context.log.error("Received Cluster.Event [\(event)]. This should not happen, please file an issue.")
147+
return .same
144148
}
145149
}
146150
}

Sources/DistributedActors/Cluster/Reception/OperationLogDistributedReceptionist.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,9 @@ extension OpLogDistributedReceptionist {
866866

867867
case .leadershipChange, .reachabilityChange:
868868
return // we ignore those
869+
870+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
871+
self.log.error("Received Cluster.Event [\(event)]. This should not happen, please file an issue.")
869872
}
870873
}
871874

Sources/DistributedActors/Cluster/Reception/_OperationLogClusterReceptionistBehavior.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,9 @@ extension _OperationLogClusterReceptionist {
608608

609609
case .leadershipChange, .reachabilityChange:
610610
return // we ignore those
611+
612+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
613+
context.log.error("Received Cluster.Event [\(event)]. This should not happen, please file an issue.")
611614
}
612615
}
613616

Sources/DistributedActors/Gossip/Gossiper+Shell.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ extension GossipShell {
328328
resolveInsertPeer(context, member: change.member)
329329
case .leadershipChange, .reachabilityChange:
330330
() // ignore
331+
case ._PLEASE_DO_NOT_EXHAUSTIVELY_MATCH_THIS_ENUM_NEW_CASES_MIGHT_BE_ADDED_IN_THE_FUTURE:
332+
context.log.error("Received Cluster.Event [\(event)]. This should not happen, please file an issue.")
331333
}
332334
}
333335
context.system.cluster.events.subscribe(onClusterEventRef)

0 commit comments

Comments
 (0)