Post

3 followers Follow
0
Avatar

ClientCacheFactory creating 3 connections upon .create()

Hello,

Does anyone have this issue where clientcachefactory established 3 connections to the server upon .create? I'm not using xml file to setup the clientcachefactory. Under the getCredentials method in UserPasswordAuthInit, I did a simple print and realized that 3 instances of my user and pass are getting passed through.

The reason why I need to debug this is to record details of the user into a region when a successful connection is made for supervising purpose but this issue is throwing me off since every successful connection produces 3 records of that particular user. I'm able to authenticate with my LDAP server with no issue and able to do authorization checking against my regions. 

Thanks in advance for inputs and help.

Jesman Ho

Official comment

Avatar

Hello Jesman,

As far as I know, authentication processes are triggered per connections of client connection pool. In this case, The pool established three connections automatically for the purpose of pooling connections even if your client application might use only one connection at that time.

It's based on client configuration such as pr-single-hop-enabled, min-connections, max-connections and so on, it could be an expected behavior.

For examples, if you have multiple cache servers in your distributed system and you set pr-single-hop-enabled=true (default value), then your GemFire client application initially tries to establish connections with all the available cache servers for single hop access optimization to access each buckets of Partitioned region. In this case, you may observe that authentication processes are triggered multiple times for each connections.

Another examples could be if you set  min-connections > 1 (with pr-single-hop-enabled=false).

 

Akihiro Kitada

Please sign in to leave a comment.

6 comments

0
Avatar

Hello Jesman,

Which version of GemFire are you using?, and how are configuring the pool?, are you using the default pool created by the Client Cache or are you creating a custom one?. Would you be willing to upload a reproducible test case?, I can try to debug it in my lab environment and try to see what's happening.

Cheers.

Juan Ramos 0 votes
0
Avatar

Hello,

Thanks for the quick reply. Unfortunately, I can't provide a test case due to my workplace restriction. 

For the info you requested:

The version is 8.1.0 build 50625

For the pool config, I am using addPoolLocator, setPoolSubscriptionEnabled(true). For .set, the following parameters : log-level, name, security-username, security-password, security-client-auth-init are used.

UserPasswordAuthInit is the same as the sample found in the gemfire folder.

Jesman Ho 0 votes
0
Avatar

Hello Akihiro Kitada,

Thanks for the explanation! So it isn't possible to configure in a way where the pool only creates one connection? And I am still unsure why does it use 3 connections and not 2 or 4 or any other numbers?

Jesman Ho 0 votes
0
Avatar

Hello Jesman,

Have you tried setting the "max-connections" limit to "1" while configuring the pool?. What's the outcome?.

This section of the User Guide describes in detail how the pool manages server connections and when/why connections are opened and closed on client side.

Cheers.

 

 

Juan Ramos 0 votes
0
Avatar

Hello Juan Ramos,

I tried using max-connections but to no avail. However when I used min and max connections together setting to 0 and 1 respectively, I get 2 connections now. It kind of solved my issue atm since I figured out how to
store 2 entries when it was 3 connections before.

Still perplexed on that extra connection and also setting both min and max connection to 1 gives 3 connection again.

In any case, thanks everyone for your helps. Greatly appreciate it!

Jesman Ho 0 votes