jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Jansz <kevin.ja...@exari.com>
Subject non-daemon Timer thread preventing JVM from stopping
Date Wed, 03 Aug 2011 03:30:39 GMT
We've identified an issue where the JVM is prevented from stopping
because of a non-daemon thread started by jackrabbit. I tracked it
down (using jstack) to the "timer" in
     * Repository-wide timer instance.
    private final Timer timer = new Timer(false);

Where the boolean is indicates if the wrapped java.util.Timer
instances get kicked off with the daemon flag. Making the change in
    private final Timer timer = new Timer(true);

Resolves the JVM shutdown issues. I'd recommend this change be made in
line with a similar change for
https://issues.apache.org/jira/browse/JCR-2752. From what I can tell
this timer is only used by the SearchIndex so no need for it to be

If more information is needed or I should raise this on the dev list
or JIRA let me know.

On a related note, I'd also like to suggest the code in
org.apache.jackrabbit.util.Timer.schedule(Task, long, long) kick off
the Timer with a name plus the daemon flag to avoid getting default
thread names in the form of "Timer-n" which make it harder to track.
Happy to submit code for this.


Kevin Jansz
Level 7, 10-16 Queen Street, Melbourne 3000 Australia
Tel +61 3 9621 2773 | Fax +61 3 9621 2776
Exari Systems
Boston | London | Melbourne | Munich

Test drive our software online - www.exari.com/demo-trial.html
Read our blog on document assembly - blog.exari.com

View raw message