Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dayaffe committed Jan 22, 2025
1 parent 79ef053 commit 624106b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public class CRTClientEngine: HTTPClient {
let acquireConnectionStart = Date().timeIntervalSinceReferenceDate
logger.info("TEST LOGGER WORKS BEFORE ACQUIRE STREAM")
// Retry logic for acquiring the stream
let stream = try await retryWithBackoff(maxRetries: 3, initialDelay: 0.5) {
let stream = try await retryWithBackoff(maxRetries: 3, initialDelay: 2) {
try await connectionMgr.acquireStream(requestOptions: requestOptions)
}
let acquireConnectionEnd = Date().timeIntervalSinceReferenceDate
Expand Down Expand Up @@ -484,6 +484,8 @@ public class CRTClientEngine: HTTPClient {
if attempt >= maxRetries - 1 {
throw error // Exhaust retries
}
let logger = SwiftLogger(label: "RetryAcquireStreamLogger")
logger.info("RETRYING ACQUIRE STREAM DUE TO \(error)")
await Task.sleep(UInt64(delay * 1_000_000_000)) // Delay before retry

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-14, Xcode_15.2, platform=macOS)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=iOS Simulator,OS=18.1,name=iPhone 16)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=tvOS Simulator,OS=18.1,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-14, Xcode_15.2, platform=tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation)...

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-14, Xcode_15.2, platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-14, Xcode_15.2, platform=iOS Simulator,OS=17.2,name=iPhone 15)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'

Check warning on line 489 in Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

View workflow job for this annotation

GitHub Actions / apple-ci (macos-15, Xcode_16.1, platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro)

'sleep' is deprecated: replaced by 'Task.sleep(nanoseconds:)'
delay *= 2 // Exponential backoff
attempt += 1
Expand Down

0 comments on commit 624106b

Please sign in to comment.