留言板

Error LockObtainTimeout when set lucene index read only

thumbnail
Daniele Tramis,修改在9 年前。

Error LockObtainTimeout when set lucene index read only

New Member 帖子: 4 加入日期: 06-10-11 最近的帖子
Hi, I have a cluster environment where the first Liferay instance is set to write indexes and the second Liferay instans has the property index.read.only=true

When the instance with index.read.only=true startup I have a LockObtainFailedExcepion at this line of the class of IndexAccessorImpl (in method _initIndexWriter):

450:                   _indexWriter = new IndexWriter(getLuceneDir(), indexWriterConfig);


I see that this method is referenced in the class constructor with other two methods:

	public IndexAccessorImpl(long companyId) {
		_companyId = companyId;

		if (!SPIUtil.isSPI()) {
			_checkLuceneDir();
			_initIndexWriter();
			_initCommitScheduler();
		}
	}


While the methods _checkLuceneDir and other into the same class check the property "index.read.only" with the method SearchEngineUtil.isIndexReadOnly(), the method _initIndexWriter() do not check the property "index.read.only" and try to initialize the writer.

There is a reason to call _initIndexWriter() even if "index.read.only" is set tu true?

Any response is appreciated.
Regards,
Daniele.