Bug 845896

Summary: Ensure that Hibernate Search shuts down cleanly
Product: [Retired] Zanata Reporter: Sean Flanigan <sflaniga>
Component: Component-LogicAssignee: Sean Flanigan <sflaniga>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developmentCC: zanata-bugs
Target Milestone: ---   
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.7.2-SNAPSHOT (20120820-0007) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-07 06:19:16 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 2012-08-06 03:20:17 UTC
The app server sometimes refuses to shut down cleanly.  I suspect this prevents Hibernate Search/Lucene from closing the index files cleanly, thus leading to some of our TM problems (eg missing results, or reindex has no effect).  We need to make sure Zanata always closes indexes properly.

Comment 1 Sean Flanigan 2012-08-08 02:17:07 UTC
Implemented a shutdown hook which prevents GWTEventService servlet from blocking shutdown for five minutes.  This should enable a clean shutdown.

In release (1.6-SNAPSHOT):
https://github.com/zanata/zanata/commit/4fe87b3430487ad55ba74fa643810e414819a310

In integration/master:
https://github.com/zanata/zanata/commit/4fe87b3430487ad55ba74fa643810e414819a310

I tried to implement another shutdown hook (a fail-safe which would close the EntityManagerFactory after 20 seconds), but Seam shuts down before it fires.  I think we just have to be careful to shut down Zanata cleanly, and if we are forced to use kill -9, we should delete the index directory before restarting.

Comment 2 Sean Flanigan 2012-08-08 02:18:23 UTC
Oh, those two links are the same because it's actually the one commit, which was merged from release into integration/master.

Comment 3 Ding-Yi Chen 2012-08-20 04:24:45 UTC
VERIFIED with Zanata version 1.7.2-SNAPSHOT (20120820-0007)

Will continue to verify 1.8 after the reindex is completed.

Comment 4 Ding-Yi Chen 2012-08-23 01:31:07 UTC
VERIFIED with Zanata version 1.8.0-SNAPSHOT (20120823-0015)

Comment 5 Sean Flanigan 2012-11-07 06:19:16 UTC
Fix released in Zanata 2.0.