This is an automated email from the ASF dual-hosted git repository.
symat pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/branch-3.5 by this push:
new 347fc1b ZOOKEEPER-4275: Prevent unnecessary client connection retry
caused by slow SASL login
347fc1b is described below
commit 347fc1b6e028aad94f4940afb1234a039fbf3946
Author: Ravi Kishore Valeti <[email protected]>
AuthorDate: Mon Apr 19 06:46:15 2021 +0000
ZOOKEEPER-4275: Prevent unnecessary client connection retry caused by slow
SASL login
Slowness in sasl login or subject.doAs() causes zk client to falsely assume
that the server did not respond, closes connection and goes to unnecessary
retries.
Raising the PR for master - approved for 3.5 branch already.
Author: Ravi Kishore Valeti <[email protected]>
Reviewers: Mate Szalay-Beko <[email protected]>, Norbert Kalmar
<[email protected]>, Mohammad Arshad <[email protected]>
Closes #1685 from rvaleti/ZOOKEEPER-4275_master
(cherry picked from commit c583a6e79654359b5daad5093d1730e370d3b75b)
---
zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
index b15ec53..2e369fc 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
@@ -1137,6 +1137,8 @@ public class ClientCnxn {
serverAddress = hostProvider.next(1000);
}
startConnect(serverAddress);
+ // Update now to start the connection timer right
after we make a connection attempt
+ clientCnxnSocket.updateNow();
clientCnxnSocket.updateLastSendAndHeard();
}