Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session timeout event doesn't fired #178

Open
GoogleCodeExporter opened this issue Feb 1, 2016 · 11 comments
Open

Session timeout event doesn't fired #178

GoogleCodeExporter opened this issue Feb 1, 2016 · 11 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.Session Timeout Event

What is the expected output? What do you see instead?
Session Timeout Event Fired, Doesn't fired

What version of the product are you using? On what operating system?
memcached-session-manager 1.6.5, tomcat 7.0.42, Cent OS 6.4, Windows 7 64bit, 
Spring Security Framework + HttpSessionListener

Please provide any additional information below.
if session.invalidate() called, session destroyed event to be fired.
but... 
When the session expires, the actual session itself has expired and the user 
can not use.
but, Session timeout event doesn't fired.

While not using memcached-session-manager, for the same environment, it is 
handled properly.

Original issue reported on code.google.com by [email protected] on 4 Sep 2013 at 2:32

@GoogleCodeExporter
Copy link
Author

+ JDK 1.7 or JDK 1.6 

Original comment by [email protected] on 4 Sep 2013 at 2:38

@GoogleCodeExporter
Copy link
Author

Do you use sticky or non-sticky configuration?

Original comment by martin.grotzke on 4 Sep 2013 at 8:14

@GoogleCodeExporter
Copy link
Author

     <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
            memcachedNodes="n1:localhost:11211"
            sticky="false"
            sessionBackupAsync="true"
            memcachedProtocol="binary"
                        operationTimeout="10000"
                        sessionBackupTimeout="10000"
            lockingMode="none"
            requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
            transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
            customConverter="kr.co.infraware.polaris.persistent.kryo.LocaleCustomization"
    />

It's My Configuration.
i used to non-sticky configuration.

Original comment by [email protected] on 4 Sep 2013 at 8:27

@GoogleCodeExporter
Copy link
Author

Ok, then it makes sense. Non-sticky session are removed from the local session 
map at the end of a request. This is needed to prevent stale session data: 
assume that tomcat1 serves request1 and sets foo=bar in the session. Afterwards 
tomcat2 handles request2 and sets foo=baz. Then tomcat1 handles request3, now 
the session should return foo=baz. If tomcat1 would keep the session locally it 
would not get the changes done by other instances. Therefore in a non-sticky 
configuration sessions are only stored in memcached and only loaded to handle a 
request.

This behaviour should be documented, this is what can be improved. But that it 
works how it works is "by design" and not a bug - sorry for that ;-)

Original comment by martin.grotzke on 4 Sep 2013 at 9:56

@GoogleCodeExporter
Copy link
Author

yeah. I got it.

I have implemented in a way that avoids this problem.

I solve this problem, but the problem is still present in the environment 
sticky.


1. Multi-WAS
2. msm is assumed to be a sticky configuration.

L4 or http server environment is set to non-sticky problem arises when the 
session expires.
(A user -> A WAS request -> C WAS connect -> after session invalid time A WAS 
Session expired -> A WAS Connect -> A Session Expired)

If you think there is a problem if this portion. document should be updated.

Original comment by [email protected] on 5 Sep 2013 at 5:32

@GoogleCodeExporter
Copy link
Author

1. Multi WAS -> Multi WAS, non-sticky loadbalancing

Original comment by [email protected] on 5 Sep 2013 at 5:33

@GoogleCodeExporter
Copy link
Author

A non-sticky loadbalancer in combination with sticky tomcat/msm does not make 
sense - you'll get stale sessions.
Is the HttpSessionListener also not invoked when you just access one tomcat and 
wait for session expiration?

Original comment by martin.grotzke on 5 Sep 2013 at 11:17

@GoogleCodeExporter
Copy link
Author

I do not know why it would stale.
anyway, If the answer to the question is ok.

one tomcat, wait for expiration...

then not invoked.

Original comment by [email protected] on 6 Sep 2013 at 5:31

@GoogleCodeExporter
Copy link
Author

Hi [email protected]

could you tell me  how u fix this top ?

Thanks.

Original comment by [email protected] on 8 Apr 2015 at 5:29

@GoogleCodeExporter
Copy link
Author

At the moment we reveted the configuration sticky on balancer and sticky on 
memcached. An initial workaround was the implementation of a thread that 
destroy the expired sessions.

Original comment by [email protected] on 9 Apr 2015 at 5:43

@GoogleCodeExporter
Copy link
Author

Issues are moved to github, this one is now 
https://github.com/magro/memcached-session-manager/issues/219. If this is still 
relevant to you please post an update to the github issue. 

Original comment by martin.grotzke on 24 Aug 2015 at 3:51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant