jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: Session concurrency warning
Date Wed, 09 Apr 2014 08:01:40 GMT

On 9.4.14 4:55 , Rob Ryan wrote:
> I can't comment to the exact meaning of the warning, but I can say
> the impact of reading from multiple threads with one session is a
> significant concern in itself given the current implementation of
> Oak.  Under high throughput conditions the lock contention quickly
> becomes a significant performance bottleneck.

Right. In general the situation is no different from Jackrabbit 2: 
sessions should not be accessed concurrently from multiple threads. The 
repository will not corrupt if doing so but wont make any guarantees 
beyond that.

More specifically, concurrent session access actually *is* more prone to 
lock contention in Oak as it was for Jackrabbit 2 even though the 
granularity of the lock is the same. In Oak there are more operations 
where we need to acquire that lock so we can make scalability guarantees 
elsewhere. One example is Node#getNodes(), which return an Iterator of 
that node's child nodes. In Jackrabbit 2 the implementation could just 
return a list of child nodes eagerly pre-fetched. Since in Oak we need 
to support large numbers of child nodes this approach would not scale 
and we need to return an Iterator that lazily fetches its children, 
acquiring the lock each time.


View raw message