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 attributes are getting lost sometime in concurrent request i guess #i added lockingmode to All but it does not seems hellping at all #283

Open
erLovepreet opened this issue Jan 10, 2016 · 37 comments

Comments

@erLovepreet
Copy link

here are my memcached configuration

FINE: Starting for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.BackupSessionTask doBackupSession

FINE: Trying to store session in memcached: 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81

Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81, returning status SUCCESS
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=D4B1CE0FFDF440D7374D0A3A3F365BBB.tomcat81, version=0, secure=false
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugResponseCookie
FINE: Request finished, with Set-Cookie header: JSESSIONID=7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81; Path=/contextpath/; HttpOnly
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /previousRequest ==================

//here i am trying to set some attribute.
--------------------------------------------setsession------------------------isLoggedIn

Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.MemcachedSessionService backupSession
FINE: No session found in session map for 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession
FINE: Stored session validity info for session 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81, version=0, secure=false
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke

FINE: <<<<<< Request finished: POST /someRequest ==================
//request which sets the attribute is over

Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.LockingStrategy pingSession
FINE: The session was ping'ed successfully.
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke

//someother request
FINE: >>>>>> Request starting: GET /someother request (requestedSessionId 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81) ==================

Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81

--------------------------getting attribute from same session but getting null

Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.BackupSessionService backupSession

//now it is trying to update the session in memcahed but session is alredy dirty read by previous request

FINE: Starting for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81, returning status SKIPPED
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession

i have tried it with locking mode also but problem is still exists
According to me the problem is thread which is calling BackupSessionTask for backup , it is taking time to update the session in memcached mean while other request do dirty read
if my guess was right you should have wait for thread before assigning session from memcached to other request

if i am missing some configuration please let me know
Thanks in advance

@erLovepreet erLovepreet changed the title Session attributes are getting lost sometime in concurent request i guess #i added lockingmode to All but it does not seems hellping at all Session attributes are getting lost sometime in concurrent request i guess #i added lockingmode to All but it does not seems hellping at all Jan 10, 2016
@magro
Copy link
Owner

magro commented Jan 11, 2016

The provided logs do not provide all information, therefore I'm not sure if anything relevant is missing. Please share the full log of the related requests.

@erLovepreet
Copy link
Author

Exactly what information you wants....because i have pasted all related logs in the post (these are tomcat logs )

@magro
Copy link
Owner

magro commented Jan 11, 2016

Are you sure you didn't remove parts of the logs? There should some more stuff being logged.

@erLovepreet
Copy link
Author

Sir these are the exact logs i havn't changed any thing as far i know
for doubt clearence i am pasting logs again

FINE: Starting for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81, returning status SUCCESS
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=D4B1CE0FFDF440D7374D0A3A3F365BBB.tomcat81, version=0, secure=false
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugResponseCookie
FINE: Request finished, with Set-Cookie header: JSESSIONID=7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81; Path=/zcubator93/; HttpOnly
Jan 09, 2016 11:10:29 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator93/control/ssologin ==================

--------------------------------------------setsession------------------------isLoggedIn

Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.MemcachedSessionService backupSession
FINE: No session found in session map for 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession
FINE: Stored session validity info for session 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81, version=0, secure=false
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator93/control/authenticate ==================
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.LockingStrategy pingSession
FINE: The session was ping'ed successfully.
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator93/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first (requestedSessionId 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81) ==================
------------------------------>>>>>>>>>>>>>>>http://zcubmem.test/zcubator93/control/nexturl
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
-------------------------------------------------------getting session attribute null---------------------------------------------------------------------

Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 7ECDF6FB9A2DF19ECD4B0C7BFA98D9AF.tomcat81, returning status SKIPPED
Jan 09, 2016 11:10:30 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession

@magro
Copy link
Owner

magro commented Jan 11, 2016

Ok, thanks!

Where does --------------------------------------------setsession------------------------isLoggedIn come from? Is this logged by POST /zcubator93/control/authenticate?

It seems as if POST /zcubator93/control/ssologin and POST /zcubator93/control/authenticate are running in parallel, is this possible?

As it seems, POST /zcubator93/control/ssologin changes the session id, and probably this is not propagated to the session map, so that POST /zcubator93/control/authenticate does not find the session and also does not update the session in memcached.

How are you changing the session id?

@erLovepreet
Copy link
Author

Where does --------------------------------------------setsession------------------------isLoggedIn come from? Is this logged by POST /zcubator93/control/authenticate?
Yes, it is logged by this jsp authenticate.jsp

It seems as if POST /zcubator93/control/ssologin and POST /zcubator93/control/authenticate are running in parallel, is this possible?
Actually it seems , but the actual case is ssologin calls authenticate

Actual case is ssologin invalidate the session and authenticate makes new session and sets a attribute
--------------------------------------------setsession------------------------isLoggedIn

but after send redirect from authenticate the variable is not visible on next jsp.
-------------------------------------------------------getting session attribute null--------------------------------------------------------------------

because session is not get updated after authenticate.jsp ...and next jsp gets session from memcached and getting value null-

@magro
Copy link
Owner

magro commented Jan 12, 2016

I'm missing the "Request starting" logs for ssologin and authenticate. What
do you mean with "ssologin calls authenticate", can you describe this is
more detail?
Am 12.01.2016 09:48 schrieb "erLovepreet" notifications@github.com:

Where does
--------------------------------------------setsession------------------------isLoggedIn
come from? Is this logged by POST /zcubator93/control/authenticate?
Yes, it is logged by this jsp authenticate.jsp

It seems as if POST /zcubator93/control/ssologin and POST
/zcubator93/control/authenticate are running in parallel, is this possible?
Actually it seems , but the actual case is ssologin calls authenticate

Actual case is ssologin invalidate the session and authenticate makes new
session and sets a attribute

--------------------------------------------setsession------------------------isLoggedIn

but after send redirect from authenticate the variable is not visible on
next jsp.
-------------------------------------------------------getting session
attribute
null--------------------------------------------------------------------

because session is not get updated after authenticate.jsp ...and next jsp
gets session from memcached and getting value null-


Reply to this email directly or view it on GitHub
#283 (comment)
.

@erLovepreet
Copy link
Author

sorry for that sir,
These are all logs

FINE: >>>>>> Request starting: POST /zcubator93/control/ssologin (requestedSessionId D88BB292CB7EFE970F1EA02AD9E6459F.tomcat81) =================
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: D88BB292CB7EFE970F1EA02AD9E6459F.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Session D88BB292CB7EFE970F1EA02AD9E6459F.tomcat81 not found in memcached.
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /zcubator93/control/authenticate (requestedSessionId E7BE4147A192682FB9085AFDBBCDC009.tomcat81) ==================
!!!!!!!!22 :
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id E7BE4147A192682FB9085AFDBBCDC009.tomcat81, returning status SUCCESS
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=D88BB292CB7EFE970F1EA02AD9E6459F.tomcat81, version=0, secure=false
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugResponseCookie
FINE: Request finished, with Set-Cookie header: JSESSIONID=E7BE4147A192682FB9085AFDBBCDC009.tomcat81; Path=/zcubator93/; HttpOnly
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator93/control/ssologin ==================
--------------------------------------------setsession------------------------isLoggedIn
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService backupSession
FINE: No session found in session map for E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.LockingStrategy pingSession
FINE: The session was ping'ed successfully.
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession
FINE: Stored session validity info for session E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=E7BE4147A192682FB9085AFDBBCDC009.tomcat81, version=0, secure=false
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator93/control/authenticate ==================
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator93/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first (requestedSessionId E7BE4147A192682FB9085AFDBBCDC009.tomcat81) ==================
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id E7BE4147A192682FB9085AFDBBCDC009.tomcat81
-------------------------------------------------------getting session attribute null---------------------------------------------------------------------
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id E7BE4147A192682FB9085AFDBBCDC009.tomcat81, returning status SKIPPED
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session E7BE4147A192682FB9085AFDBBCDC009.tomcat81
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.LockingStrategy pingSession
FINE: The session was ping'ed successfully.
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=E7BE4147A192682FB9085AFDBBCDC009.tomcat81, version=0, secure=false
Jan 10, 2016 10:41:02 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /zcubator93/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first ==================

I hope this time you have all the logs . please let me know if i m missing anything
Thanks in advance

What do you mean with "ssologin calls authenticate", can you describe this is more detail?
sir actually ssologin.jsp invalidate the session and it submit a form to authentication.jsp
and as you can see authentication create new session and set same attributes( that i m having problem of getting lost because of thread delay) .... authentication.jsp again call response.send redirect to /nexturl as u can see in logs .... and while nexturl request (i an using struts2 framework) interceptor gets call and inquire the attribute that is earlier set by authentication.jsp .... this request seems parallel as you can see in logs request of authentication.jsp is finished after interceptor inquires about attribute from session.

magro pushed a commit that referenced this issue Jan 13, 2016
This shall support the case where the request creating the session
invokes another page (e.g. via forward) that then runs "in parallel".

Refs #283
@erLovepreet
Copy link
Author

sir the problem is still there ... :(
do you understand the problem ? means why this problem is reproducing Please let me know ..... as far i get , the problem is concurrent request.

@magro
Copy link
Owner

magro commented Jan 15, 2016

I had a theory for the reason (yes, related to concurrent requests), but it
seems to be wrong. Can you share logs for the issue with the new
version/jars?
Am 15.01.2016 10:08 schrieb "erLovepreet" notifications@github.com:

sir the problem is still there ... :(
do you understand the problem ? means why this problem is reproducing
Please let me know ..... as far i get , the problem is concurrent request.


Reply to this email directly or view it on GitHub
#283 (comment)
.

@magro
Copy link
Owner

magro commented Feb 8, 2016

@erLovepreet Can you please also update to the latest version 1.9.1 and share logs for concurrent requests / the issue?

@erLovepreet
Copy link
Author

Hi sir,

Sorry for late reply , i got that problem and i applied temporary solution for that problem.
and i have used SNAPSHOT jars but i am getting some other problem
i have used these two jars rest are same
memcached-session-manager-1.9.0-RC2-SNAPSHOT.jar
memcached-session-manager-tc8-1.9.0-RC2-SNAPSHOT(1).jar

This doesnot even work in our project environment
in our project we authenticate user and create session and set variable like isLoggedIn -true to session and then our interceptor checks every time whether user requested with particular session have that variable or not if not it will redirect user to login screen thats what our project do

now about new jars
problem is : every time i login it redirect to login success but at very next request it redirect user to again login screen

i am sharing logs of login time and very next request

login time logs

Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /zcubator9315/control/authenticate (requestedSessionId 3EB70B36E7D164E105044C0A18A5238D.tomcat81) ==================
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 3EB70B36E7D164E105044C0A18A5238D.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Session 3EB70B36E7D164E105044C0A18A5238D.tomcat81 not found in memcached.
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
!!!!!!!!22 :

......................................this is where isLoggedin in set in session.........................

canAccessCustomerFeedback>>>>>>>>>>>>>>>>>>>>>>>>>>>>>true
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81, returning status SUCCESS
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=3EB70B36E7D164E105044C0A18A5238D.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugResponseCookie
FINE: Request finished, with Set-Cookie header: JSESSIONID=6B0996AAC22C2B8C934C1587D5435905.tomcat81; Path=/zcubator9315/; HttpOnly
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator9315/control/authenticate ==================
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first (requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81) ==================
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81, returning status SUCCESS
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=6B0996AAC22C2B8C934C1587D5435905.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /zcubator9315/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/marketingCenter (requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81) ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Ignoring: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png (requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81) ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService requestFinished
FINE: Session 6B0996AAC22C2B8C934C1587D5435905.tomcat81 is still used by another request, skipping backup and (optional) lock handling/release.
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Ignored: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png ==================
recentPPCCallsExist false
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81, returning status SUCCESS
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=6B0996AAC22C2B8C934C1587D5435905.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /zcubator9315/control/marketingCenter ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Ignoring: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png (requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81) ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id 44C08DD05006678837759C0C540132E0.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Ignored: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Ignoring: GET /zcubator9315/static/Fran091211/onboard/loading_background.png (requestedSessionId 44C08DD05006678837759C0C540132E0.tomcat81) ==================
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 44C08DD05006678837759C0C540132E0.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 44C08DD05006678837759C0C540132E0.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 44C08DD05006678837759C0C540132E0.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Ignored: GET /zcubator9315/static/Fran091211/onboard/loading_background.png ==================

next request logs

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/nexturl?nextUrl=main&menuName=intranet&subMenuName=first (requestedSessionId 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81) ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Session 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81 not found in memcached.
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81, returning status SUCCESS
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugResponseCookie
FINE: Request finished, with Set-Cookie header: JSESSIONID=31F5CECBD45876A87B6D37F3C756B8DF.tomcat81; Path=/zcubator9315/; HttpOnly
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /zcubator9315/control/nexturl?nextUrl=main&menuName=intranet&subMenuName=first ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/login?message=NoSession (requestedSessionId 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81) ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedBackupSessionManager removeInternal
FINE: remove invoked, removeFromMemcached: true, id: 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService deleteFromMemcached
FINE: Deleting session from memcached: 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService backupSession
FINE: No session found in session map for 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=31F5CECBD45876A87B6D37F3C756B8DF.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /zcubator9315/control/login?message=NoSession ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Ignoring: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg (requestedSessionId 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81) ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Ignored: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Ignoring: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg (requestedSessionId 190BF4EECA221851DD3FFBF0B78098AB.tomcat81) ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81 (isConnectoogin time and very next request
rSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService findSession
FINE: Returning for session id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81 (isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id 0525CC2D10556ADC28C1AEA4BBC6DA10.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Ignored: GET /zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg ==================

@magro
Copy link
Owner

magro commented Feb 11, 2016

Ok. My next hypothesis is that the issue is caused by assets (png, jpg
etc), that a new session is created for them. To verify this, can you
please remove the requestUriIgnorePattern attribute and report what's
happening and share logs again?
Am 11.02.2016 07:42 schrieb "erLovepreet" notifications@github.com:

Hi sir,

Sorry for late reply , i got that problem and i applied temporary solution
for that problem.
and i have used SNAPSHOT jars but i am getting some other problem
i have used these two jars rest are same
memcached-session-manager-1.9.0-RC2-SNAPSHOT.jar
memcached-session-manager-tc8-1.9.0-RC2-SNAPSHOT(1).jar

This doesnot even work in our project environment
in our project we authenticate user and create session and set variable
like isLoggedIn -true to session and then our interceptor checks every time
whether user requested with particular session have that variable or not if
not it will redirect user to login screen thats what our project do

now about new jars
problem is : every time i login it redirect to login success but at very
next request it redirect user to again login screen

i am sharing logs of login time and very next request

login time logs

Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Request starting: POST /zcubator9315/control/authenticate

(requestedSessionId 3EB70B36E7D164E105044C0A18A5238D.tomcat81)

Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Loading session from memcached:
3EB70B36E7D164E105044C0A18A5238D.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Session 3EB70B36E7D164E105044C0A18A5238D.tomcat81 not found in
memcached.
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: Created new session with id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
!!!!!!!!22 :

......................................this is where isLoggedin in set in
session.........................

canAccessCustomerFeedback>>>>>>>>>>>>>>>>>>>>>>>>>>>>>true
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionService
backupSession
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionTask
doBackupSession
FINE: Trying to store session in memcached:
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81,
returning status SUCCESS
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.LockingStrategy
onAfterBackupSession
FINE: Stored session validity info for session
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null,
value=3EB70B36E7D164E105044C0A18A5238D.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugResponseCookie
FINE: Request finished, with Set-Cookie header:
JSESSIONID=6B0996AAC22C2B8C934C1587D5435905.tomcat81; Path=/zcubator9315/;
HttpOnly
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke

FINE: <<<<<< Request finished: POST /zcubator9315/control/authenticate

Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Request starting: GET
/zcubator9315/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first

(requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81)

Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Loading session from memcached:
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:14 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Found session with id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionService
backupSession
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask
doBackupSession
FINE: Trying to store session in memcached:
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81,
returning status SUCCESS
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.LockingStrategy
onAfterBackupSession
FINE: Stored session validity info for session
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null,
value=6B0996AAC22C2B8C934C1587D5435905.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Request finished: GET

/zcubator9315/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/marketingCenter

(requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81)

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Loading session from memcached:
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Found session with id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Ignoring: GET
/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png

(requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81)

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
requestFinished
FINE: Session 6B0996AAC22C2B8C934C1587D5435905.tomcat81 is still used by
another request, skipping backup and (optional) lock handling/release.
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Ignored: GET

/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png

recentPPCCallsExist false
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionService
backupSession
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask
doBackupSession
FINE: Trying to store session in memcached:
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81,
returning status SUCCESS
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.LockingStrategy
onAfterBackupSession
FINE: Stored session validity info for session
6B0996AAC22C2B8C934C1587D5435905.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null,
value=6B0996AAC22C2B8C934C1587D5435905.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke

FINE: <<<<<< Request finished: GET /zcubator9315/control/marketingCenter

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Ignoring: GET
/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png

(requestedSessionId 6B0996AAC22C2B8C934C1587D5435905.tomcat81)

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 6B0996AAC22C2B8C934C1587D5435905.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: Created new session with id 44C08DD05006678837759C0C540132E0.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Ignored: GET

/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/buildLogo.png

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Ignoring: GET
/zcubator9315/static/Fran091211/onboard/loading_background.png

(requestedSessionId 44C08DD05006678837759C0C540132E0.tomcat81)

Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 44C08DD05006678837759C0C540132E0.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 44C08DD05006678837759C0C540132E0.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 44C08DD05006678837759C0C540132E0.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: Created new session with id 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81
Feb 11, 2016 11:58:15 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Ignored: GET

/zcubator9315/static/Fran091211/onboard/loading_background.png

next request logs

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Request starting: GET
/zcubator9315/control/nexturl?nextUrl=main&menuName=intranet&subMenuName=first

(requestedSessionId 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81)

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Loading session from memcached:
4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Session 4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81 not found in
memcached.
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: Created new session with id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionService
backupSession
FINE: Starting for session id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionTask
doBackupSession
FINE: Trying to store session in memcached:
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81,
returning status SUCCESS
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.LockingStrategy
onAfterBackupSession
FINE: Stored session validity info for session
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null,
value=4ACA10FC49E11DD32DEC5F6F7073A143.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugResponseCookie
FINE: Request finished, with Set-Cookie header:
JSESSIONID=31F5CECBD45876A87B6D37F3C756B8DF.tomcat81; Path=/zcubator9315/;
HttpOnly
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Request finished: GET

/zcubator9315/control/nexturl?nextUrl=main&menuName=intranet&subMenuName=first

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Request starting: GET
/zcubator9315/control/login?message=NoSession (requestedSessionId
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81) ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Loading session from memcached:
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
loadFromMemcached
FINE: Found session with id 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM
de.javakaffee.web.msm.MemcachedBackupSessionManager removeInternal
FINE: remove invoked, removeFromMemcached: true, id:
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
deleteFromMemcached
FINE: Deleting session from memcached:
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
backupSession
FINE: No session found in session map for
31F5CECBD45876A87B6D37F3C756B8DF.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null,
value=31F5CECBD45876A87B6D37F3C756B8DF.tomcat81, version=0, secure=false
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Request finished: GET
/zcubator9315/control/login?message=NoSession ==================
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Ignoring: GET
/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg

(requestedSessionId 31F5CECBD45876A87B6D37F3C756B8DF.tomcat81)

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: Created new session with id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Ignored: GET

/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: >>>>>> Ignoring: GET
/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg

(requestedSessionId 190BF4EECA221851DD3FFBF0B78098AB.tomcat81)

Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81
(isConnectoogin time and very next request
rSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
findSession
FINE: Returning for session id 190BF4EECA221851DD3FFBF0B78098AB.tomcat81
(isConnectorSessionLookup: false, isIgnoredRequest: true)
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: createSession invoked: null
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.MemcachedSessionService
createSession
FINE: Created new session with id 0525CC2D10556ADC28C1AEA4BBC6DA10.tomcat81
Feb 11, 2016 11:58:45 AM de.javakaffee.web.msm.RequestTrackingHostValve
invoke
FINE: <<<<<< Ignored: GET

/zcubator9315/tenants/AdvantaClean/static/Fran091211/images/loginLogo.jpg


Reply to this email directly or view it on GitHub
#283 (comment)
.

@erLovepreet
Copy link
Author

Sir,
Bad news doesn't work again :(

here's the log

Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /franconnect9315/control/othersidelogin?clientKey=BASE_TEST (requestedSessionId 6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81) ==================
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id 6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81

tabUrl==========null
clientKey=BASE_TEST

.......................I gona call invalidate...........................

Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedBackupSessionManager removeInternal
FINE: remove invoked, removeFromMemcached: true, id: 6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService deleteFromMemcached
FINE: Deleting session from memcached: 6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService backupSession
FINE: No session found in session map for 6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=6D2647B3A9A5C3049376CDAC02BA68FD.tomcat81, version=0, secure=false
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /franconnect9315/control/othersidelogin?clientKey=BASE_TEST ==================
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /zcubator9315/control/ssologin (requestedSessionId 44AAAEAD9DE90088D5088874D01CD258.tomcat81) ==================
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: 44AAAEAD9DE90088D5088874D01CD258.tomcat81
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Session 44AAAEAD9DE90088D5088874D01CD258.tomcat81 not found in memcached.
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: createSession invoked: null
Feb 12, 2016 12:37:45 PM de.javakaffee.web.msm.MemcachedSessionService createSession
FINE: Created new session with id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /zcubator9315/control/authenticate (requestedSessionId F3FBB268522CA19FC05BD77F1F9123BF.tomcat81) ==================
!!!!!!!!22 :
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81, returning status SUCCESS

......................................this is where isLoggedin in set in session.........................

Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=44AAAEAD9DE90088D5088874D01CD258.tomcat81, version=0, secure=false
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugResponseCookie
FINE: Request finished, with Set-Cookie header: JSESSIONID=F3FBB268522CA19FC05BD77F1F9123BF.tomcat81; Path=/zcubator9315/; HttpOnly
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator9315/control/ssologin ==================
canAccessCustomerFeedback>>>>>>>>>>>>>>>>>>>>>>>>>>>>>true
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.MemcachedSessionService backupSession
FINE: No session found in session map for F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession
FINE: Stored session validity info for session F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=F3FBB268522CA19FC05BD77F1F9123BF.tomcat81, version=0, secure=false
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: POST /zcubator9315/control/authenticate ==================
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.LockingStrategy pingSession
FINE: The session was ping'ed successfully.
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first (requestedSessionId F3FBB268522CA19FC05BD77F1F9123BF.tomcat81) ==================
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionService backupSession
FINE: Starting for session id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Starting for session id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.BackupSessionTask call
FINE: Finished for session id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81, returning status SKIPPED
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.LockingStrategy onAfterBackupSession
FINE: Stored session validity info for session F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve logDebugRequestSessionCookie
FINE: Have request session cookie: domain=null, maxAge=-1, path=null, value=F3FBB268522CA19FC05BD77F1F9123BF.tomcat81, version=0, secure=false
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: <<<<<< Request finished: GET /zcubator9315/control/nexturl?nextUrl=marketingCenter&menuName=zcubator&subMenuName=first ==================
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.LockingStrategy pingSession
FINE: The session was ping'ed successfully.
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: GET /zcubator9315/control/login?message=NoSession (requestedSessionId F3FBB268522CA19FC05BD77F1F9123BF.tomcat81) ==================
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Loading session from memcached: F3FBB268522CA19FC05BD77F1F9123BF.tomcat81
Feb 12, 2016 12:37:46 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
FINE: Found session with id F3FBB268522CA19FC05BD77F1F9123BF.tomcat81

One thing i want you to know that this only occurs when previous request takes too much time to execute. means we can reproduce it with the help of thread.sleep().

@magro
Copy link
Owner

magro commented Feb 13, 2016

Can you create a reproducable sample based on https://github.com/magro/memcached-session-manager/tree/master/samples? Then I can check and analyze this.

@magro
Copy link
Owner

magro commented Mar 7, 2016

@erLovepreet How's it going, can you create a reproducable sample for your issue?

@mirion
Copy link

mirion commented Mar 24, 2016

I also noticed a similar issue. Digging into the logs I found the following stack trace:

WARNING: Could not load session with id 99124C00B7D1AFEAA5DF8697B74C4E81 from memcached.
java.lang.NullPointerException
    at de.javakaffee.web.msm.MemcachedSessionService.loadFromMemcached(MemcachedSessionService.java:1138)
    at de.javakaffee.web.msm.MemcachedSessionService.findSession(MemcachedSessionService.java:595)
    at de.javakaffee.web.msm.MemcachedBackupSessionManager.findSession(MemcachedBackupSessionManager.java:208)
    at org.apache.catalina.connector.Request.isRequestedSessionIdValid(Request.java:2374)
    at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1236)
    at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:921)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:517)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

Configuration:
Tomcat: 8.0.32
msm: 1.9.2 using a local memcache node

Thanks for any hint. If I can help with some more detailed logs, please let me know how to enable them. Thanks.

@magro
Copy link
Owner

magro commented Mar 24, 2016

@mirion can you reproduce this issue on your local machine or does it only happen in production from time to time? I'll have a look at the NPE soon.

@magro
Copy link
Owner

magro commented Mar 24, 2016

@mirion The NPE at this line is really weird - is it possible that this happened during startup or shutdown phase? Did you see it one or during a very short period, ofter several times during otherwise normal operation?

@mirion
Copy link

mirion commented Mar 24, 2016

@magro, The NPE may indeed appear during an app reload as I found the stack trace into eclipse.

I noticed initially that the sessions are expiring very quickly (few minutes). Since we just moved to tomcat 8, I was thinking that we missed some configuration but I checked the settings and everything is looking fine.

I can now reproduce the problem (not the NPE) into my local development environment. If you could give me some instructions on how to debug it, we may make some progress and eventually fix it.

The configuration that I'm using is the following (into context.xml):

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="localhost:11211" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"/>

I also noticed something very strange. It looks like the session is found into memcache but it is not restored correctly/completely. For example, I'm storing the database connection URL and after the session restore I'm getting a NPE when trying to use that URL. I have the main credentials object but they are missing that particular piece of information. This is really weird. Do you think that it may be an issue with kryo? On the other hand, we are using kryo for other stuff and I didn't notice any problem.

@magro
Copy link
Owner

magro commented Mar 24, 2016

@mirion Great that you're able to reproduce it!

  1. Re quick expiration: in tomcat indeed things changed, see also commit eddf4c4. If it's only happening with msm and not without msm then please submit a separate issue for this.

  2. Re incomplete deserialization: the config you posted does not mention kryo, so either kryo cannot be the reason, or the config you posted was incomplete ;-) Assuming the latter, you can change the serializer/transcoder to java and see if this solves the issue. Then it would have to do with kryo, and the solution would be either to use java serialization or with kryo to write/configure custom serializers for problematic classes. Does it happen only with the same certain classes (which once?), or randomly with different classes?

@magro
Copy link
Owner

magro commented Mar 24, 2016

Btw, I just noticed that URLs in fact cannot be (de)serialized with kryo...

@mirion
Copy link

mirion commented Mar 24, 2016

@magro Thanks a lot.

  1. I'll take a look at commit #eddf4c4. If I understand well, I should remove session-timeout from conf/web.xml and use maxInactiveInterval into the Manager's def?
    I can't reproduce the bug without msm because I have a complex system that uses several webapps in the same time. msm helps me to obtain a sort of SSO and also load balancing.
  2. My mistake. Initially we used kryo, but had some trouble with it (don't remember what exact happened - it may be related to this: readClassAndObject throws KryoException: Buffer underflow. EsotericSoftware/kryo#128). Therefore we switched to Java serialization. I'll try again with kryo.
  3. I have the impression that we have a sort of race condition because it happens when 2 requests are sent about in the same time to 2 different webapps that are supposed to share the same session.
  4. What shall I do in order to activate the debug log?

Thnaks.

@mirion
Copy link

mirion commented Mar 24, 2016

We are not saving the URL as an object but the coordinates of the server and we later compose the JDBC URL to build the datasource if needed. I'll make a code inspection to check if the session manager bug is not triggering in fact a bug into our code, that otherwise can't arise because we are supposed to have a good session with all the data available.

In any case, beyond this serialization issue, the session expiration still exists.

@magro
Copy link
Owner

magro commented Mar 25, 2016

Re 1: you shouldn't have to do anything, I just wanted to mention that things in tomcat had changed. The mentioned commit handles this already.

Re 3: not sure what happens when different webapps share the same session - things may go wrong (because the manager/msm has no longer control)

@mirion
Copy link

mirion commented Mar 25, 2016

@magro
Re 1. I was forced to set maxInactiveInterval into the manager. I know that is deprecated, but for unknown reasons I was not able to convince tomcat to use the value from web.xml (which was working well into version 7.0). I made a quick inspection of the code, but I couldn't find anything suspect.

Re 3. There was a problem with my local tomcat configuration. The Context didn't have sessionCookiePath="/" Once this set, it started to work perfectly. In fact, there is no reason why several webapps should not be able to share the same session (which is the case now). If I'm understanding correctly the mechanism, the session manager that is loaded by the container provides the sessions to the different applications. Therefore it is supposed to work, and it does. This mechanism combined with msm provides great load balancing infrastructure. Thanks a lot for your work.

@magro
Copy link
Owner

magro commented Mar 25, 2016

Great to hear that it's working now! Although I'd say that for each webapp a dedicated manager instance exists, which is necessary for appropriate lifecycle handling.

Strange to hear that the session timeout in web.xml doesn't work - was it the webapps web.xml or the global one? Does it also not work without msm?

@mirion
Copy link

mirion commented Mar 25, 2016

I'm sure that you know better how the session managers are working. I didn't dig into your code, but I suppose that you (synchronously?) save the session into the storage (memcache). Therefore even if the manager is different, the session can be can be recovered by another webapp. Since I never noticed any issue, even under heavy load (during load tests) I arrived at the conclusion that the sessions data is effectively shared. And it looks that I'm not the only one using the same procedure: http://forum.broadleafcommerce.org/viewtopic.php?t=4184 If my findings are supported by your code, it may be useful to put this info into the wiki. If I'm just benefiting from a side effect, it may make sense to harden this path and fully embrace it. Shared session managers are a common issue.

It was the global web.xml. I didn't remove the setting but I noticed that it is useless. Will check again when I'll have more time available.

@magro
Copy link
Owner

magro commented Mar 25, 2016

To have synchronous session backup you must configure sessionBackupAsync=false. Parallel requests going to different webapps will produce race conditions (if they're both/all write/modify the session). If it's working for you this is great, but it's nothing I'd publicly support (right now). To handle parallel requests maybe session locking as it's done for non-sticky sessions might be a way, but this would have to be implemented / changed so that it can work with sticky sessions.

@mirion
Copy link

mirion commented Mar 25, 2016

I understand. I was assuming from the beginning that it is possible to get race conditions. Therefore the session is created once (at login) and never updated. I'll follow your advice and set sessionBackupAsync = false

Thanks a lot again for your help and your great software.

@magro
Copy link
Owner

magro commented Mar 25, 2016

You're welcome :-) If the session is not updated (by parallel requests) and there are no very fast subsequent requests you could also stay with sessionBackupAsync=true (if this is already working for you :-)) Cheers

@magro magro closed this as completed Apr 12, 2016
@adriansn
Copy link

Hello, I'm working on the same project as mirion.
I took over the analysis of our Memcached issue (attributes disappearing sometimes from the session following a timeout in a multi-webapps context) and I think I found the cause and I maybe have a solution. Do you prefer having a new issue, or should I proceed here with the details?
Thanks.

@magro
Copy link
Owner

magro commented May 17, 2016

@adriansn It's fine to continue here if it's not a totally different story :-)

@magro magro reopened this May 17, 2016
@adriansn
Copy link

adriansn commented May 18, 2016

Normally, this is the same issue. Sorry for the delay in my response, was trying to minimise the changes, but it's not easy...
Here is the story: We have several webapps that execute in the same Tomcat server (version 8 now), but no clustering or load balancing for now. Consider only two webapps, Sync that performs (among other tasks) the login and Viewer that provides details on a document. We didn't notice any problem in the previous Tomcat 7 deployment, but in the new one we had, randomly, strange messages saying that a document was not available (in fact, the credentials attached to the session were not present).
We set a very short session timeout and we noticed that, once a timeout occurred and a new login was performed via Sync, the Viewer would not be able to retrieve the session and/or the credentials for it (randomly, unfortunately - sometimes it works).
After debug, we understood that the local cache of sessions for Viewer had a buggy session object, whose thisAccessedTime/lastAccessedTime were not properly updated, according to the latest accesses via Sync.
The fix that I propose is to check against Memcached repository any "timeouted" session. Here is the code I added to the beginning of the method de.javakaffee.web.msm.MemcachedSessionService.findSession():

        MemcachedBackupSession result = _manager.getSessionInternal( id );
        if( result != null ) {
            long maxInactiveInterval = result.getMaxInactiveInterval() * 1000;
            long idleTimeInterval = result.getIdleTimeInternal();
            boolean attrsEmpty = result.getAttributesInternal().isEmpty();
            if( ( idleTimeInterval > maxInactiveInterval ) || attrsEmpty ) {
                result = loadFromMemcached( id );
                if( result != null ) {
                    result.access();
                    result.endAccess();
                    result.storeThisAccessedTimeFromLastBackupCheck();
                }
            }
            else {
                result.access();
                result.endAccess();
                result.storeThisAccessedTimeFromLastBackupCheck();
            }
        }

I tried to remove the references to session time-related attributes and to the session attributes themselves, but the results were not satisfying.
Using attrsEmpty should be configurable, since not having attributes in the session may be a valid situation (it is not in our case).
I assume there are easier ways to achieve what I intend to do. Please let me know if I was clear enough and if yes, whether you agree with my fix proposal.

@adriansn
Copy link

Sorry, forgot one "detail". In order to ensure compatibility with previous versions of Tomcat, I added the following method to de.javakaffee.web.msm.MemcachedBackupSession class:

    public long getIdleTimeInternal()
    {
        long timeNow = System.currentTimeMillis();

        if (LAST_ACCESS_AT_START)
            return timeNow - this.lastAccessedTime;
        return timeNow - this.thisAccessedTime;
    }

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

4 participants