Bug 1244612

Summary: Zanata sometimes leaves Hibernate Search .lock files in the index directory after shutdown
Product: [Retired] Zanata Reporter: Sean Flanigan <sflaniga>
Component: Component-Logic, DeploymentAssignee: Sean Flanigan <sflaniga>
Status: CLOSED CURRENTRELEASE QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.6CC: djansen, zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.8.0-SNAPSHOT (git-server-3.6.2-600-gb34e317) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-04 00:27:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sean Flanigan 2015-07-20 07:20:17 UTC
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

Comment 1 Sean Flanigan 2015-07-20 07:33:42 UTC
(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

Comment 2 Damian Jansen 2015-07-29 02:23:52 UTC
Verified at d11a347477028904c5fb3d7541b0099098ffaf02