Red Hat Bugzilla – Bug 845896
Ensure that Hibernate Search shuts down cleanly
Last modified: 2015-07-20 03:33:42 EDT
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.
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):
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.
Oh, those two links are the same because it's actually the one commit, which was merged from release into integration/master.
VERIFIED with Zanata version 1.7.2-SNAPSHOT (20120820-0007)
Will continue to verify 1.8 after the reindex is completed.
VERIFIED with Zanata version 1.8.0-SNAPSHOT (20120823-0015)
Fix released in Zanata 2.0.