0

我们的应用程序每 2 小时左右就会崩溃一次,并且在此之前我们看到数据库连接量激增。还没有孤立这个问题。

有人可以回答以下异常的真正含义吗?它是否会引发数据库连接问题。

谢谢你。

org.compass.core.engine.SearchEngineException: Failed to open writer for sub index [premiumobjectmessage]; nested exception is org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock
org.compass.core.engine.SearchEngineException: Failed to open writer for sub index [premiumobjectmessage]; nested exception is org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock
org.compass.core.engine.SearchEngineException: Failed to open writer for sub index [premiumobjectmessage]; nested exception is org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock
4

1 回答 1

1

这源于多个线程/进程想要打开相同的FSDirectory. 可能每个拥有自己的数据库连接的线程也会自己创建IndexReader,这将是一种错误的方法。IndexReaders/ IndexSearchers 必须像数据库连接本身一样被池化,最好使用NRTManager.

于 2012-08-17T16:27:39.493 回答