Skip to main content

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

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.


Back to the top