Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty clustering not working properly (jettySessions expiryTime getting set to 0 after sometime)

The JDBCSessionManager persists and reloads the expiry time of the
session into the SessionData (see loadSession(), storeSession() and
updateSession() methods). The session scavenging expiry code does
database queries to find candidates to expire.

The JDBCSessionManager.Session.access() method will reset the expiry
time, so if the session migrates from node1 to node2, that access
method will be called and use the maxIdleTime of the node2 to
calculate the expiry - are you sure node2 has the correct maxIdleTime
set?

If you've checked your config, and you can establish a scenario where
the expiryTime is not being set correctly, I'll certainly take a look
at it.

regards
Jan

On 28 May 2012 14:13, venkat_99 <venkaiahp@xxxxxxxxx> wrote:
> Hi,
> We are using Jetty 7.5.1. We have JDBCSessionManager configured to serialize
> the JSESSIONID, we have set MaxInactiveTimeInterval as 120.We have two nodes
> running on the load balancer, what we have observed is whenever a request
> from a session which was served by node1 before goes to node2 the expiryTime
> is getting set to zero.
>
> When we tried to debug jetty-server src the below constructor in the
> AbstractSession
>
> protected AbstractSession(AbstractSessionManager abstractSessionManager,
> long created, long accessed, String clusterId)
>    {
>        _manager = abstractSessionManager;
>        _created=created;
>        _clusterId=clusterId;
>        _nodeId=_manager._sessionIdManager.getNodeId(_clusterId,null);
>        _accessed=accessed;
>        _lastAccessed=accessed;
>        _requests=1;
>        __log.debug("new session "+_nodeId+" "+_clusterId);
>    }
>
> doesn't seem to serialize or set _maxIdleMs whereas in the other constructor
> it does.
> protected boolean access(long time)
>        {
>            if (super.access(time))
>            {
>                _data.setLastAccessed(_data.getAccessed());
>                _data.setAccessed(time);
>
>                int maxInterval=getMaxInactiveInterval();
>                _data.setExpiryTime(maxInterval <= 0 ? 0 : (time +
> maxInterval*1000));
>                return true;
>            }
>            return false;
>        }
>  public int getMaxInactiveInterval()
>    {
>        checkValid();
>        return (int)(_maxIdleMs/1000);
>    }
> Due to this the access method inside of Session is setting the expiryTime of
> SessionData based on _maxIdleMs of Session which is zero. This is making
> expiryTime zero. Is this a bug / are we missing some configration in Jetty?
>
>
>
>
>
> --
> View this message in context: http://jetty.4.n6.nabble.com/Jetty-clustering-not-working-properly-jettySessions-expiryTime-getting-set-to-0-after-sometime-tp4958537.html
> Sent from the Jetty User mailing list archive at Nabble.com.
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top