Skip to Content.
Sympa Menu

grouper-dev - RE: [grouper-dev] Strange error while creating groups

Subject: Grouper Developers Forum

List archive

RE: [grouper-dev] Strange error while creating groups


Chronological Thread 
  • From: Chris Hyzer <>
  • To: "" <>, Grouper Dev <>
  • Subject: RE: [grouper-dev] Strange error while creating groups
  • Date: Tue, 11 Aug 2009 12:16:06 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US

One problem is in ehcache:

for (int i = 0; i < ALL_CACHE_MANAGERS.size(); i++) {
CacheManager cacheManager = (CacheManager)
ALL_CACHE_MANAGERS.get(i);

I think if a cache is removed in another thread (GC) between those lines,
then you can the out of bounds exception... I looked in the latest ehcache,
and the implementation is a little different as far as multi-threaading, but
this bug still is there.

I opened a bug report with ehcache:
http://sourceforge.net/tracker/?func=detail&aid=2835670&group_id=93232&atid=603559
Either way, we should upgrade to the latest soon.

I noticed that GrouperSession does not close caches on "stop()", but only on
finalize() (during garbage collection). So the caches will bulk up until
garbage collection... so I think a medium term solution is to close caches
on GrouperSession.stop(). If there aren't 200 cache managers, this is less
likely to happen...

An easy solution that might help is to synchronize the cache creation on the
same resource that the cache remove in ehcache is synchronized...

Can you confirm you are on the 1.4 branch, and I can try to implement
something there that should fix this?

Another solution which shouldn't be necessary is to have a static root
grouper session (but still do the callbacks)....

In other words, something like this

FROM:

/**
* Creates a group if it does not exist, removes all its members
otherwise .
* @param definition The definition of the group.
* @see
org.esco.dynamicgroups.dao.grouper.IGroupsDAOService#resetGroupMembers(DynamicGroupDefinition)
*/
public void resetGroupMembers(final DynamicGroupDefinition definition) {
try {
final GrouperSession session =
GrouperSession.start(SubjectFinder.findRootSubject(), false);
GrouperSession.callbackGrouperSession(session,
new ResetGroupMembersCallback(this,
definition.getGroupUUID()));
} catch (SessionException e) {
LOGGER.error(e, e);
}
}

TO:

private final static GrouperSession rootSession = null;

private static GrouperSession rootSession() {
if (rootSession == null) {
try {
rootSession = GrouperSession.start(SubjectFinder.findRootSubject(),
false);
} catch (SessionException e) {
LOGGER.error(e, e);
}
}
return rootSession;
}

/**
* Creates a group if it does not exist, removes all its members
otherwise .
* @param definition The definition of the group.
* @see
org.esco.dynamicgroups.dao.grouper.IGroupsDAOService#resetGroupMembers(DynamicGroupDefinition)
*/
public void resetGroupMembers(final DynamicGroupDefinition definition) {
try {
GrouperSession.callbackGrouperSession(rootSession(),
new ResetGroupMembersCallback(this,
definition.getGroupUUID()));
} catch (SessionException e) {
LOGGER.error(e, e);
}
}

> -----Original Message-----
> From: Arnaud Deman
> [mailto:]
> Sent: Tuesday, August 11, 2009 10:34 AM
> To: Grouper Dev
> Subject: [grouper-dev] Strange error while creating groups
>
> Hello,
>
> I am trying to stress test an extension of grouper that I have written
> and of course ... it crashes :-( .
>
> It is no deterministic : this time it occurred after creating more than
> 4500 groups but sometime it happens after 300 group creations.
> Initially I thought it was because of a bad use of the grouper
> sessions but I have corrected everything to use the callback
> mechanism.
>
> I have joined the stack and the instruction which generates the
> exception is :
>
> (in the method resetGroupMembersInternal)
>
> @SuppressWarnings("unchecked")
> final Set<Member> members = group.getImmediateMembers();
>
> If someone has an idea of a direction to investigate, I would really
> appreciate because I am not very inspired...
>
>
>
> Thanks,
> Arnaud.
>
>
> --
>
> Arnaud Deman
> GIP RECIA
> Parc d'activit├ęs les Aulnaies
> 151 rue de la Juine - 45160 OLIVET
> Tel : 02 38 42 14 69
>




Archive powered by MHonArc 2.6.16.

Top of Page