Kundera Cassandra -with Spring : Thread Leak seen

86 views
Skip to first unread message

nitin sharma

unread,
Dec 9, 2015, 2:48:36 PM12/9/15
to kundera-discuss
Hi All,

My application runs on Weblogic and talks to Cassandra as backend db for which we have used Kundera cassandra client...
we have also used spring framework to handle the EnitityManagerFactory lifecycle..

During our failover testing we have seen an  increase in Cassandra Connection pool thread count with the restart of cassandra node... we have seen the thread count goes upto 600+ even though we had specified "kundera.pool.size.max=40" for our 8 node Cassandra cluster..

we are using "Kundera-cassandra-2.11.1.jar" and "Kundera-core-2.11.1.jar" ..


My persistent.xml:
<?xml version="1.0" encoding="UTF-8"?>
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    <persistence-unit name="cassandratesting">
        <provider>com.impetus.kundera.KunderaPersistence</provider>
        <properties>
       <property name="kundera.dialect" value="cassandra"/>
           
     
       <property name="kundera.nodes" value="******"/>
       <!-- the port number for the thrift protocol-->
   <property name="kundera.port" value="***"/>
   <property name="kundera.keyspace" value="***"/>
   <property name="kundera.username" value="****"/>
   <property name="kundera.password" value="*****"/>
   <property name="kundera.pool.size.max.total" value="40"/>
   <property name="kundera.pool.size.max.active" value="10"/>
   <property name="kundera.pool.size.min.idle" value="2"/>
   <property name="kundera.pool.size.max.idle" value="5"/>
   <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory"/>      
            <property name="kundera.client.property" value="kunderaLoadTestingConfig.xml" />           
        </properties>
    </persistence-unit>
</persistence>



====================
and  KunderaLoadTestingConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<clientProperties>
  <datastores>
   <dataStore>
    <name>cassandratesting</name>
    <connection>
     <servers>
     <!-- List and configure all nodes below -->
     <server>
<host>******</host>
<port>****</port>
<properties>
<property name="kundera.username" value="****"/>
<property name="kundera.password" value="****"/>
<property name="testwhileidle" value="true"></property>
<property name="socket.timeout" value="10000"></property>
<property name="failover.policy" value="on.fail.try.one.next.available"></property>
<property name="retry" value="true"></property>
    </properties>
     </server>
</dataStore>
</datastores>
</clientProperties>


Chhavi Gangwal

unread,
Dec 11, 2015, 8:09:17 AM12/11/15
to kundera-discuss
Which version of Cassandra server are you using ? I suggest if you are using 2.2.+ , please update Kundera libraries to 3.2 as older versions are not compatible with the latest Cassandra releases.

Chhavi

nitin sharma

unread,
Dec 15, 2015, 11:51:45 AM12/15/15
to kundera-discuss
hi...

thanks for your response...

I am using 2.0.14.459 version.. and i have tried kundera 2.11.1 and 2.12.. result is same..

will 3.2 version is meant for the cassandra version mentioned above..

regards

Chhavi Gangwal

unread,
Dec 16, 2015, 1:49:31 AM12/16/15
to kundera-discuss
yes please use kundera-cassndra client version 3.2 for latest Cassandra version.

Chhavi

Bin Grokker

unread,
Dec 18, 2015, 6:29:03 PM12/18/15
to kundera-discuss
Hi Nitin,

Is your problem solved?

Thanks,
Bin
Message has been deleted

Devender Yadav

unread,
Dec 22, 2015, 4:00:04 AM12/22/15
to kundera-discuss

nitin sharma

unread,
Dec 23, 2015, 11:45:00 AM12/23/15
to kundera-discuss


Hi Chhavi and Ben,

Sorry for delay in my response...

i have tried with 3.2 version of Kundera limbraries and got stuck with other issue --

When i restart one of the cassandra node in the cluster, Kundera doesnt' reconnect to that node as long as the application is running.. i keep getting "java.net.SocketException: Broken pipe".. 

I am reposting my KunderLoadConfig.xml.. kindly let me know if i need to add any other parameters..

will parameters like "testonborrow,testonconnect,testonreturn"will be of any help here

<?xml version="1.0" encoding="UTF-8"?>
<clientProperties>
  <datastores>
   <dataStore>
    <name>cassandratesting</name>
    <connection>
     <servers>
     <!-- List and configure all nodes below -->
     <server>
<host>******</host>
<port>****</port>
<properties>
<property name="kundera.username" value="****"/>
<property name="kundera.password" value="****"/>
<property name="testwhileidle" value="true"></property>
<property name="socket.timeout" value="10000"></property>
<property name="failover.policy" value="on.fail.try.one.next.available"></property>
<property name="retry" value="true"></property>
    </properties>
     </server>
<properties>
    <property value="3.0.0" name="cql.version"/>
    <property value="RoundRobinPolicy" name="loadbalancing.policy"/>
    <property value="true" name="retry"/> 
     <property value="1" name="retry.delay"/> 
     <property value="10000" name="max.wait"/>
 </properties>
</connection>
</dataStore>
</datastores>
</clientProperties>

karthik prasad

unread,
Dec 24, 2015, 6:38:42 AM12/24/15
to kundera-discuss
Did you add all the nodes in "kundera.nodes" property?

Example:

<property name="kundera.nodes" value="192.168.xx.01,192.168.xx.02,192.168.xx.03"/>

-Karthik

nitin sharma

unread,
Dec 26, 2015, 8:24:56 PM12/26/15
to kundera-discuss
Yes Karthik, i have

that's why i am able to see same number of Cassandra-Connection thread in the beginning.. 

and after i restart one node, i dont see my code accepting the restarted node.. it keeps throwing message that node is down..


Reply all
Reply to author
Forward
0 new messages