-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make connection retry timeout default consistent #105
base: main
Are you sure you want to change the base?
Conversation
Makes the connection retry timeout consistent regardless of whether no value is specified, or `nil` is specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @fabianfett how can I trigger CI with the current setup?
@swift-server-bot please test |
@swift-server-bot test |
1 similar comment
@swift-server-bot test |
@swift-server-bot please test |
@swift-server-bot add to allowlist |
I'm not sure what the tests are trying to do here, but I notice that only "soundness," 5.6, 5.7, and 5.8 have a "required" label, but the rest do not (in particular, 5.9 and 5.10). |
Welp, my code no longer builds. I'm not sure why. Let me fix it. |
@0xTim Sorry about that, not sure what happened. But all’s good now, I think. |
@Joannis I think this is good to go? |
@@ -134,7 +136,7 @@ extension RedisConnectionPool { | |||
self.minimumConnectionCount = minimumConnectionCount | |||
self.connectionRetryConfiguration = ( | |||
(initialConnectionBackoffDelay, connectionBackoffFactor), | |||
connectionRetryTimeout ?? .milliseconds(10) // always default to a baseline 10ms | |||
connectionRetryTimeout ?? Self.defaultConnectionRetryTimeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a breaking change. Explicitly passing nil currently leads to a timeout of 10ms. We would change that to 60sec. This can lead to unexpected behavior for adopters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long to review this. Thanks for raising the issue and providing a potential fix.
While I agree that #104 absolutely has a point, I think that this change is a breaking behavior change, that we should not go forward with today. This issue can only be fixed in the next major. Adopters have a clear way around this issue, by passing an explicit value or omitting the parameter. Just explicitly passing nil is currently a bad option.
While I am generally loathe to make breaking changes, I’m not sure in this case it’s cut-and-dry. Here are my thoughts.
At the very least, the documentation and example should make it clear this is an issue. |
It's also not a breaking change - it's a change in behaviour for sure but code will still compile which is what SemVer defines as breaking changes. Whether it should be accepted is still a question for the maintainers though |
Fix for #104. Makes the connection retry timeout consistent regardless of whether no value is specified, or
nil
is specified.Test failures seem to be due to the specific test comparing floats:
Test Suite 'StringCommandsTests' failed at 2024-03-20 15:05:53.225.
Executed 17 tests, with 2 failures (0 unexpected) in 0.576 (0.577) seconds
Test Suite 'RediStackPackageTests.xctest' failed at 2024-03-20 15:05:53.225.
Executed 264 tests, with 2 failures (0 unexpected) in 38.703 (38.716) seconds
Test Suite 'All tests' failed at 2024-03-20 15:05:53.225.
Executed 264 tests, with 2 failures (0 unexpected) in 38.703 (38.717) seconds