Hi Guys,
I believe im experiencing deadlock with my mass indexer. Recently we have changed our mass indexer config to see if we can increase our throughput time in finishing indexing quicker. This has had a side effect in which our app hangs.
We currently have 8 classes which are indexed. (So 8 indexes in total). Our mass indexer config is as follows
batch.indexer.batch.size=100
batch.indexer.fetch.threads=5
batch.indexer.load.objects=2
When configured like this, the indexer never gets started.......i see no log outputs. A thread dump reveals the following to me
I have
40 threads of type "Hibernate Search: collectionsloader-4" - Of which 23 are looking for a DB connection (5 * 8 = 40)
16 threads of type "Hibernate Search: entityloader-2" Of which 12 are looking for a DB connection. (8 * 2 = 16)
8 threads of type "Hibernate Search: identifierloader-1" - All 8 are awaiting a connection
All the above threads are stuck waiting for "awaitAvailable" to retrieve a connection.
Quote:
"Hibernate Search: identifierloader-1" prio=10 tid=0x000000004ff28000 nid=0xe44 in Object.wait() [0x0000000048360000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1315)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
- locked <0x00000000bed85908> (a com.mchange.v2.resourcepool.BasicResourcePool)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
at org.hibernate.impl.StatelessSessionImpl.beginTransaction(StatelessSessionImpl.java:480)
So i have 43 threads all waiting for a DB connection!!
My c3po config is standard enough
Quote:
#connection pooling props
hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
hibernate.c3p0.acquire_increment=1
hibernate.c3p0.idle_test_period=100
hibernate.c3p0.max_size=20
hibernate.c3p0.max_statements=20
hibernate.c3p0.min_size=5
hibernate.c3p0.timeout=1000
When i seen this my first reaction is deadlock.......when i dont use such a high "fetch" and "load" config i dont see this issue. Have you guys a test case for running the mass indexer when the number of threads looking for connections exceeds the pool size??
Also came across this in my searching for a solution
https://jira.atlassian.com/browse/BAM-5670 different product i know but the symptoms are similar to what im experiencing.
Any thoughts on this??
LL