Skip to content

Commit 581aef7

Browse files
committed
Fix rebase problems
1 parent 8e5d98e commit 581aef7

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Sources/DistributedActors/Cluster/ClusterShell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ internal class ClusterShell {
280280
}
281281

282282
/// Actually starts the shell which kicks off binding to a port, and all further cluster work
283-
internal func start(system: ClusterSystem, clusterEvents: ClusterEventStream) throws -> _ActorRef<Message> {
283+
internal func start(system: ClusterSystem, clusterEvents: ClusterEventStream) async throws -> _ActorRef<Message> {
284284
let instrumentation = system.settings.instrumentation.makeInternalActorTransportInstrumentation()
285285
self._serializationPool = try _SerializationPool(settings: .default, serialization: system.serialization, instrumentation: instrumentation)
286286
self.clusterEvents = clusterEvents

Sources/DistributedActors/Cluster/SWIM/SWIMActorShell.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ internal distributed actor SWIMActorShell: CustomStringConvertible {
3131

3232
private lazy var swim = SWIM.Instance(settings: self.customizeSWIMSettings(self._settings), myself: self)
3333

34-
private lazy var timers = ActorTimers<SWIMActorShell>(self)
35-
3634
private lazy var log: Logger = {
3735
var log = Logger(actor: self)
3836
log.logLevel = self._settings.logger.logLevel
@@ -102,8 +100,9 @@ internal distributed actor SWIMActorShell: CustomStringConvertible {
102100
}
103101

104102
case .scheduleNextTick(let delay):
105-
// Keep scheduling the timer (cancelAfter = false) so that it fires for each tick
106-
self.timers.startSingle(key: SWIMActorShell.protocolPeriodTimerKey, delay: .nanoseconds(delay.nanoseconds), cancelAfter: false) {
103+
// Keep scheduling the timer so that it fires for each tick
104+
Task {
105+
try await Task.sleep(until: .now + .nanoseconds(delay.nanoseconds), clock: .continuous)
107106
self.handlePeriodicProtocolPeriodTick()
108107
}
109108
}
@@ -549,8 +548,6 @@ extension SWIMActorShell {
549548
ps._wellKnown = true
550549
return ps.metrics(group: "swim.shell", measure: [.serialization, .deserialization])
551550
}
552-
553-
static let protocolPeriodTimerKey = _TimerKey("\(SWIMActorShell.name)/periodic-ping")
554551
}
555552

556553
extension ActorID {

Tests/DistributedActorsTests/Cluster/SWIM/SWIMActorShellClusteredTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ final class SWIMShellClusteredTests: ClusteredActorSystemsXCTestCase {
136136

137137
// FIXME: use a non-responsive test probe instead of real system
138138
// Down the node so it doesn't respond to ping
139-
thirdNode.shutdown()
139+
try thirdNode.shutdown()
140140
try await self.ensureNodes(.removed, on: secondNode, nodes: thirdNode.cluster.uniqueNode)
141141

142142
let originPeer = try SWIMActorShell.resolve(id: first.id._asRemote, using: secondNode)
@@ -456,7 +456,7 @@ final class SWIMShellClusteredTests: ClusteredActorSystemsXCTestCase {
456456
private func awaitStatus(
457457
_ status: SWIM.Status, for peer: SWIMActorShell,
458458
on swimShell: SWIMActorShell, within timeout: Duration,
459-
file: StaticString = #file, line: UInt = #line, column: UInt = #column
459+
file: StaticString = #filePath, line: UInt = #line, column: UInt = #column
460460
) async throws {
461461
let testKit = self.testKit(swimShell.actorSystem)
462462

0 commit comments

Comments
 (0)