Keep indexer running till finished on VM shutdown

Description

Hi all, I've just installed and got running hibernate search - very cool!
But a very minor enancement would help a lot I think, for those of us still in testing mode and not using the jms option yet.
It would be very handy if there was a config option for the async executorService to stay up and complete its tasks after the app itself has been shutdown.

In BatchedQueueingProcessor finalize just need to add something like this line after the executorService.shutdown();( if its set to wait in the config somewhere of course), or even better replace the params here with user defined entries from config.

executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS );

The only other feature I'd like is the capability to use Spring jms instead of the jboss one out of the box. 🙂

Great product.

Cheers
Jason.

Activity

Show:

Emmanuel Bernard January 7, 2008 at 8:58 PM

I've applied your initial proposal.
The event listener I am waiting for is the SessionFactory.close() one

December 16, 2007 at 7:30 AM

Yeh the finalizer thing is pretty naf, I suggested it because that where the current shutdown resides.
I had also considered that if the pool were exposed - perhaps via a new hib-search event/listener interface 🙂 - then it would be possible to register a listener to catch the shutdown event and programaticaly do whatever you like on shutdown. it would be trivial to supply a default listener to handle the most common cases.

Emmanuel Bernard December 16, 2007 at 3:00 AM

Interesting, it worths a look. I don't like finalizers though, I wish there were a better solution, maybe daemon/non-daemon threads.

Out of the box, Hibernate Search works with any JMS provider, I only use the standard APIs. I don't know what Spring did in this area but I won't use a proprietary API for such a trivial thing 🙂 And I don't think Spring has a JMS implementation, they probably have some wrappers delegating to an implementation.

Fixed

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged0.5h remaining

Components

Fix versions

Priority

Created December 14, 2007 at 10:14 PM
Updated November 13, 2008 at 6:08 PM
Resolved January 7, 2008 at 8:58 PM

Flag notifications