[Geoserver-devel] [Geoserver-users] Session timeout for GeoServer

Chris Holmes wrote:

Cool, thanks for the explanations guys. Yeah, go ahead and file a bug.

Jody, I think you originally designed this, as the way to get at the configuration data. Is there an easy fix, or does it involve rewriting how we access the configuration? If there's an easy way I'd like to do it soon, if not we should note it for when we redo the configuration. But I feel we may actually be somewhat tied to it for now.

Um we are supposed to look up things in the ApplicationContext ... if someone can change the code to go directly to the ApplicationContext that would be cool.
Jody

Chris

Corey Puffalt wrote:

Chris,

On 7/28/06, *Chris Holmes* <cholmes@anonymised.com <mailto:cholmes@anonymised.com>> wrote:

    Corey Puffalt wrote:

[...]

     > That said, I think a bug should be filed because as far as I can
    tell,
     > both the WMS & WFS protocols are stateless so GeoServer shouldn't be
     > creating a session. (I'm not as familiar with WFS but WMS is
    definitely
     > stateless).
    Yeah, this is the issue for me, is that the protocols are inherently
    stateless. So what is the bug that needs to be filed?

The bug is that GeoServer shouldn't be creating HttpSessions at all since it shouldn't need them (except for the administration web interface). I'm not very familiar with the GeoServer codebase but I've noticed that servlet.getSession() is called a lot in order to gain access to ServletContext like so:

        HttpSession session = request.getSession();
        ServletContext context = session.getServletContext();

This isn't necessary since the ServletContext is available directly from Servlet and could be stored elsewhere for use later.

    What resources does it hold on to? If it's not releasing resources then
    that's a problem. But I don't quite understand the number of sessions
    growing fast, when wms and wfs are stateless. Or do we just need to set
    a default of expiring sessions after a minute or so? A new session is
    created for every WMS/WFS call? I'm not sure what resources are being
    held on to though, as I'm pretty positive we release all the database
    connections and whatnot right away.

Simply creating a ServletSession ties up resources on the server whether you're storing anything in it or not. Expiring sessions after a minute or so would fall into the "hack" category.

Corey
!DSPAM:1003,44ca3231146911995013331!