Closed
Description
AsyncHTTPClient commit hash: a220837 (Release 1.21.1)
While trying to use HTTPClientRequest
on macOS (with NIOTransportServices
), I noticed that refused connection errors are only thrown when the connection timeout expires.
With the following code, it takes 90 seconds (the connection timeout specified in HTTPClient.Configuration.singletonConfiguration
) until the error is thrown:
import AsyncHTTPClient
var request = HTTPClientRequest(url: "https://localhost:12345/")
let response = try await HTTPClient.shared.execute(request, timeout: .hours(1))
I'd consider a refused connection a non-recoverable error and would expect execute
to throw right away.
- Is awaiting the timeout expected behavior here?
- Is there a way to not wait in this situation while using
HTTPClientRequest
?
Environment:
$ swift --version
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Operating system: macOS Sonoma 14.5 (23F79)
Metadata
Metadata
Assignees
Labels
No labels