Today I've had a look at continuation invalidation. I found following code fragment in the ContinuationManagerImpl:
// REVISIT: This places only the "leaf" nodes in the expirations Sorted Set.
// do we really want to do this?
if (parent.getChildren().size() < 2) {
expirations.remove(parent);
}
Is it right that this means that only if a leaf continuation expires, the continuations tree is walked up and parent continuations are checked whether they have expired?
Yes, all children continuation have to expire for the parent to be removed.
If you have a long expiration time set, does it mean that the whole! tree is never checked for invalidation? (If you have a system with hundreds of users that are logged in that quickly leads to memory problems ...)And if you design your application in the way that one continuation tree is used for the whole session it will be removed from memory one hour (by default) after user logs out.
If I'm right I think of making the ContinuationsManagerImpl inheritable (currently some protected methods and constructors prevent this) so that the expiration strategy can be overriden. comments? objections?we should change the default behaviour I think. I do not see a single advantage of this approach (apart from quite straightforward implementation).
Question is: what behaviour do we expect?
The easiest implementation would be: 1. detach all leaves 2. attach leaves as roots 3. invalidate parent continuation 4. optionally: recurse the check for parent's parent.
we may skip 4. but then continuation count might grow faster than they are harvested. I am not currently aware how this affects the feature of storing continuations in session.
As I am quite fresh on ContinuationsManager details so I may change the implementation.
-- Leszek Gawron [EMAIL PROTECTED] IT Manager MobileBox sp. z o.o. +48 (61) 855 06 67 http://www.mobilebox.pl mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65