Skip to content

Commit

Permalink
Debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBusch committed Oct 13, 2023
1 parent 9eff7ba commit bc50f46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/ServiceLifecycle/ServiceGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,11 @@ public actor ServiceGroup: Sendable {
// We have to spawn an unstructured task here because the call to our `run`
// method might have already been cancelled and we need to protect the sleep
// from being cancelled.
let uuid = UUID()
cancellationTimeoutTask = Task {
do {
self.logger.debug(
"Task cancellation timeout task started."
"Task cancellation timeout task started. \(uuid)"
)
try await Task.sleep(for: Duration(
secondsComponent: maximumCancellationDuration.secondsComponent,
Expand All @@ -677,7 +678,7 @@ public actor ServiceGroup: Sendable {
self.logger.debug(
"Cancellation took longer than allowed by the configuration."
)
fatalError("Cancellation took longer than allowed by the configuration.")
fatalError("Cancellation took longer than allowed by the configuration \(uuid).")
} catch {
// We got cancelled so our services must have finished up.
}
Expand All @@ -699,3 +700,5 @@ extension AsyncStream {
return (stream: stream, continuation: continuation!)
}
}

import Foundation

0 comments on commit bc50f46

Please sign in to comment.