jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: non-daemon Timer thread preventing JVM from stopping
Date Wed, 03 Aug 2011 10:21:15 GMT

On Wed, Aug 3, 2011 at 5:30 AM, Kevin Jansz <kevin.jansz@exari.com> wrote:
> 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
> org.apache.jackrabbit.core.RepositoryContext:

This timer object should get cancelled (and the related thread closed)
when you shutdown the repository. Are you sure your repository is
closed when you're stopping the JVM?

On Wed, Aug 3, 2011 at 10:49 AM, Stefan Guggisberg
<stefan.guggisberg@gmail.com> wrote:
> i don't know why the repository global timer instance is created
> as 'non-daemon' but there might be a reason for it. jukka
> can probably answer this question.

My rationale for not using a daemon thread was that the lifetime of
the thread is already managed by the repository, i.e. the thread ends
when the repository is closed.

It probably doesn't hurt to make the timer a daemon thread like was
done in JCR-2752 for the pool threads, but in both cases I feel that
the only real benefit of doing so is to make life easier for people
who don't properly manage the repository lifecycle (and harder for
people who try to track down possible problems because of that).


Jukka Zitting

View raw message