I think login object is static to achieve some optimization in refreshing the 
TGT. Currently multiple ZooKeeper client can run in one JVM but all must share 
same configuration, principal. Because all the clients share same principal, 
one login object is enough to serve the purpose.

There are many things which cannot be done without making the login object not 
static. some are
1) Multiple ZooKeeper clients in a single JVM each having different principals, 
must have separate login object, more detail in ZOOKEEPER-2139
2) Cannot close TGT refresh thread in login object on close of 
ZooKeeper.close() API call, more detail in ZOOKEEPER-2330

I am +1 for making login object in ZooKeeperSaslClient non static

Best Regards
Arshad

-----Original Message-----
From: Flavio Junqueira [mailto:f...@apache.org] 
Sent: 23 March 2016 03:22
To: Zookeeper
Subject: Login object in ZooKeeperSaslClient

Hello,

I've been looking at the ZooKeeperSaslClient class, and I've been wondering why 
the Login object is static in that class. Is it only to avoid having one login 
thread for each concurrent session? I'd like to make it non-static because this 
way we can have multiple handles in the same jvm using different 
configurations. We'd also need to pass the login configuration separately.

I had a look at the ZOOKEEPER-938 jira for some insight, but couldn't get any. 
Any other insight here would be great.

-Flavio

Reply via email to