-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
broker: remove 5s minimum for sasl session lifetime
Previously, if a broker returned <5000ms for a sasl session lifetime, the client would reject the lifetime and close the connection. This would result in a log and a failed request, and the error was technically not retriable. The Java client uses anywhere from 85% to 95% of the lifetime no matter what (uniform random range, plus / minus jitter). So, no lower bound. We remove the lower bound and instead switching to taking 2.5s off the lifetime, or the latency of the authentication itself, whichever is larger. If subtracting 2.5s immediately expires the sasl, we sleep 100ms to avoid hot looping, but the next write will cause a reauthentication. As a final bit of validation, if we loop reauthenticating 15x (which is an overkill allowance already), we kill the connection and retry on a new connection. The new introduced error is considered a retriable broker err.
- Loading branch information
Showing
2 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters