Description of problem: Sometimes when stopping the jbossas service, one or more .lock files are left under /var/lib/zanata/index. When this happens, the Lucene indexes *may* be left in an inconsistent state. If so, I think it could cause problems with search results, unless the indexes are deleted (I haven't found any documentation which says either way). We should ensure that the Hibernate Search SessionFactory is shut down cleanly, by registering a shutdown listener to call close on the SessionFactory. Version-Release number of selected component (if applicable): 3.6.2 How reproducible: Rare, probably depends on load Steps to Reproduce: 1. Install jbossas and zanata from rpms 2. Stop jbossas, preferably while changes are happening. 3. Check under /var/lib/zanata/index for .lock files Actual results: Sometimes there are leftover .lock files, which indicates that Hibernate Search did not shut down cleanly. Expected results: No .lock files. Additional info: See https://bugzilla.redhat.com/show_bug.cgi?id=1125472 and https://bugzilla.redhat.com/show_bug.cgi?id=1125472
(One of the "see also"s in the bug description was meant to be bug 845896.) Pull request: https://github.com/zanata/zanata-server/pull/920
Verified at d11a347477028904c5fb3d7541b0099098ffaf02