-
1. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jaikiran Jun 26, 2012 3:36 AM (in response to nickarls)1 of 1 people found this helpfulDoesn't your application invalidate sessions explicitly? I think (and I'm not really sure) the maxInactiveInterval will only be checked for if there's a subsequent access to the session after the timeout.
-
2. Re: HttpSessions not cleaned out, server grinds to a halt(?)
nickarls Jun 26, 2012 3:41 AM (in response to jaikiran)Yes, the sessions are invalidated at normal logout. However, from the login screen, I sometimes see *two* sessions created. Don't know where the other one comes from but I thought it would just die away after a while ;-/
-
3. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jaikiran Jun 26, 2012 4:09 AM (in response to nickarls)I guess it's that second session you'll have to track down and fix.
-
4. Re: HttpSessions not cleaned out, server grinds to a halt(?)
nickarls Jun 26, 2012 4:10 AM (in response to jaikiran)Are there any conditions that could trigger the two-session-syndrome? A resource request GET from the same page?
-
5. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jaikiran Jun 26, 2012 4:35 AM (in response to nickarls)Nicklas Karlsson wrote:
Are there any conditions that could trigger the two-session-syndrome?
Perhaps an easier way to track it would be to configure your implementation of HttpSessionListener http://docs.oracle.com/javaee/5/api/javax/servlet/http/HttpSessionListener.html and do a Thread.dumpStacktrace() in the sessionCreated() callback method.
-
6. Re: HttpSessions not cleaned out, server grinds to a halt(?)
nickarls Jun 26, 2012 7:14 AM (in response to jaikiran)Hmm. I think it is something related to referencing a CDI SessionScoped bean from a session listener. The session context has some lazy loading mechanism for creating the backing storage (http session) on demand so the creation of a session creates a session (that gets abandon and hangs around)...
-
7. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jaikiran Jun 26, 2012 7:36 AM (in response to nickarls)Perhaps a question for the Weld mailing list/forum then? If you do create that discussion, please link it here. I'm curious to see what it is.
-
8. Re: HttpSessions not cleaned out, server grinds to a halt(?)
nickarls Sep 3, 2012 2:13 AM (in response to jaikiran)I though I got rid of this but apparently no. My next guess is that I have a DB-backed JSF ResourceHandler that uses an injected CDI dependent-scoped object that somehow get stuck.
But from a AS perspective, what is the reasoning that lastAcessedTime=0 session are (presumed to) be excluded from the cleanup? One would think that if they are iterated and chosen to be ignored, the assumption would be that they are always skipped and that would indicate knowledge that they are going to accumulate over time.
-
9. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jaikiran Sep 3, 2012 3:49 AM (in response to nickarls)Moved this to JBossWeb forum. Someone there might have an answer.
-
10. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jfclere Sep 3, 2012 5:11 AM (in response to jaikiran)hm that session looks weird: isNew = true means that you just create it and it was never accessed by a request. It looks like you create it in your login/logout logic.
-
11. Re: HttpSessions not cleaned out, server grinds to a halt(?)
nickarls Sep 3, 2012 5:19 AM (in response to jfclere)This thingie in StandardSession probably explains why it's not cleaned out
(well the accessCount shows an AtomicInteger but it's probably 0 since the access time is 0)
public boolean isValid() { ... if (ACTIVITY_CHECK && accessCount.get() > 0) { return true; } ... }
I don't do anything unusual(tm), need to go over my JSF ResourceHandler. Perhaps something in my logout/session invalidation that creates a last, desparate session when going through the JSF lifecycle that sticks around
Any workarounds until then (short of slacking the second condition above and recompiling)?
Message was edited by: Nicklas Karlsson
-
12. Re: HttpSessions not cleaned out, server grinds to a halt(?)
jfclere Sep 3, 2012 5:24 AM (in response to nickarls)try -Dorg.apache.catalina.session.StandardSession.ACTIVITY_CHECK=false -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false
-
13. Re: HttpSessions not cleaned out, server grinds to a halt(?)
nickarls Sep 3, 2012 6:26 AM (in response to jfclere)Hey, initial tests (5 session login/logout + Eclipse MAT) looks promising, I'll try to sneak it into production and then I can really tell. Thanks for the help, it'll keep me floating until I can trace the lifecycle of those strange sessions.