Open afeick opened 1 year ago
Thanks for taking the time to file this. You're absolutely right, this is a bug and I think your fix is correct (although we shouldn't default the minimum timeout to 20, we should just defer to the underlying bootstrap). Could you open a PR to fix this?
@glbrntt - all tests are green locally and PR is submitted. Can you approve the workflow so I can make sure the build and tests are all good in GHA?
Describe the bug
Connection timeout is ignored on last retry or when retries are set to none.
ConnectionManager.startConnecting
uses aConnectionBackoffIterator
to determine theconnectTimeout
here: Sources/GRPC/ConnectionManager.swift#L988Unfortunately when the
ConnectionBackoffIterator
is on its last (or only) try, it returnsnil
for the next value here: Sources/GRPC/ConnectionBackoff.swift#L140That means the connection timeout is the bootstrap default, which in my use case is 10 seconds: swift-nio-transport-services/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift#L57
To reproduce
Expected behaviour
Call should timeout after 1 second, but it's taking 10 seconds.
Additional information
This is sorta ugly, but it does resolve the issue for me locally: