You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Jukka Zitting <ju...@gmail.com> on 2014/01/09 15:51:15 UTC

Re: svn commit: r1556779 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java

Hi,

On Thu, Jan 9, 2014 at 5:31 AM,  <mr...@apache.org> wrote:
> +                if (repo instanceof JackrabbitRepository) {
> +                    ((JackrabbitRepository) repo).shutdown();
> +                }

This looks ugly. It would be nice if the JCR repository wrapper around
 was stateless, i.e. could simply be collected as normal garbage when
no longer used.

BR,

Jukka Zitting

Re: svn commit: r1556779 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Jan 9, 2014 at 10:04 AM, Michael Dürig <md...@apache.org> wrote:
> What's the purpose of having a shutdown method then?
>
> JackrabbitRepository.shutdown() clearly states: "This method [...]
> <em>must</em> therefore be called by the client application once the
> repository instance is no longer used."

The shutdown() method is troublesome for various reasons [1,2,3]. As
suggested in JCR-2958, I'd opt to deprecate it in the API and have Oak
implement it as a no-op.

[1] https://issues.apache.org/jira/browse/JCR-2958
[2] http://markmail.org/message/dsqyv3rafo4j5xea
[3] http://markmail.org/message/ghfqwhivipkxakwh

BR,

Jukka Zitting

Re: svn commit: r1556779 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java

Posted by Michael Dürig <md...@apache.org>.

On 9.1.14 4:00 , Marcel Reutegger wrote:
>> On Thu, Jan 9, 2014 at 5:31 AM,  <mr...@apache.org> wrote:
>>> +                if (repo instanceof JackrabbitRepository) {
>>> +                    ((JackrabbitRepository) repo).shutdown();
>>> +                }
>>
>> This looks ugly. It would be nice if the JCR repository wrapper around
>>   was stateless, i.e. could simply be collected as normal garbage when
>> no longer used.
>
> yes, this would indeed be cleaner and require to revisit the changes
> for OAK-941. those changes actually introduced the issue with a
> scheduled executor that needs to be shut down.

What's the purpose of having a shutdown method then?

JackrabbitRepository.shutdown() clearly states: "This method [...] 
<em>must</em> therefore be called by the client application once the 
repository instance is no longer used."

Michael

>
> regards
>   marcel
>

Re: svn commit: r1556779 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Jan 9, 2014 at 10:00 AM, Marcel Reutegger <mr...@adobe.com> wrote:
> yes, this would indeed be cleaner and require to revisit the changes
> for OAK-941. those changes actually introduced the issue with a
> scheduled executor that needs to be shut down.

Right. One potential solution would be to expose just a single MBean
that uses TabularData to return information about all the currently
active sessions (sorted by lifetime). Then we wouldn't need to limit
the output to just long-lived sessions, and wouldn't have to worry
about excessive service registrations or extra background tasks.

BR,

Jukka Zitting

RE: svn commit: r1556779 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java

Posted by Marcel Reutegger <mr...@adobe.com>.
> On Thu, Jan 9, 2014 at 5:31 AM,  <mr...@apache.org> wrote:
> > +                if (repo instanceof JackrabbitRepository) {
> > +                    ((JackrabbitRepository) repo).shutdown();
> > +                }
> 
> This looks ugly. It would be nice if the JCR repository wrapper around
>  was stateless, i.e. could simply be collected as normal garbage when
> no longer used.

yes, this would indeed be cleaner and require to revisit the changes
for OAK-941. those changes actually introduced the issue with a
scheduled executor that needs to be shut down.

regards
 marcel