strongit / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Multiple session id's getting created in msm + memcached #202

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. msm + JavaSerilization + spring mvc 

2. <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
            sticky="false"
            memcachedNodes="n1:lxdm620m7:11211,n2:lxdm491m7:11211"
            lockingMode="all"
            requestUriIgnorePattern=".*\.(png|gif|jpg|css|js|ico)$"
            sessionBackupAsync="false"
            sessionBackupTimeout="100"
    />

3. The application has two different webapps deployed and both are 
(context.xml) configured with MSM

What is the expected output? What do you see instead?

Expected to be one session id to be created in memcached, but I see numerous 
session id.

What version of the product are you using? On what operating system?
What version of the product are you using? On what operating system?
spymemcached-2.10.2.jar
memcached-session-manager-tc6-1.8.1.jar
memcached-session-manager-1.8.1.jar
tomcat-6.0.23

Please provide any additional information below.
lxdm491m7 
========
<34 get ping-n2
>34 END
<34 set bak:B13619494440EB26B72524D92A0BF38D-n1.tomcat1 2050 3600 6700
>34 STORED
<34 set bak:validity:B13619494440EB26B72524D92A0BF38D-n1.tomcat1 2048 1800 20
>34 STORED
<34 get ping-n2
>34 END
<34 get ping-n2
>34 END
<34 set 474CB3EB3630CC30416ADB2413EFF407-n2.tomcat1 2050 3600 6268
>34 STORED
<34 set validity:474CB3EB3630CC30416ADB2413EFF407-n2.tomcat1 2048 1800 20
>34 STORED
<34 set A69964A85A44E1E0A98604196F06FD78-n2.tomcat1 2050 3600 6342
>34 STORED
<34 set validity:A69964A85A44E1E0A98604196F06FD78-n2.tomcat1 2048 1800 20
>34 STORED
<34 set B36436C8506165AE3FE1E6B3FCE917E6-n2.tomcat1 2050 3600 6270
>34 STORED
<34 set validity:B36436C8506165AE3FE1E6B3FCE917E6-n2.tomcat1 2048 1800 20
>34 STORED
<34 set 5050AA0FB5C31BB09A152E34A3D7266E-n2.tomcat1 2050 3600 6345
>34 STORED
<34 set validity:5050AA0FB5C31BB09A152E34A3D7266E-n2.tomcat1 2048 1800 20
>34 STORED
<34 set 702BB50D3E55B387AC78A7182C860EB6-n2.tomcat1 2050 3600 6308
>34 STORED
<34 set validity:702BB50D3E55B387AC78A7182C860EB6-n2.tomcat1 2048 1800 20
>34 STORED
<34 get ping-n2
>34 END
<34 set bak:E659131B192E1853A99DE1C28CC10E14-n1.tomcat1 2050 3600 6340
>34 STORED
<34 set bak:validity:E659131B192E1853A99DE1C28CC10E14-n1.tomcat1 2048 1800 20
>34 STORED
<34 set bak:3A7C2E63CD1A712F403EF78370424039-n1.tomcat1 2050 3600 6269
>34 STORED
<34 set bak:validity:3A7C2E63CD1A712F403EF78370424039-n1.tomcat1 2048 1800 20
>34 STORED
<34 set bak:30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1 2050 3600 6347
>34 STORED
<34 set bak:validity:30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1 2048 1800 20
>34 STORED

lxdm620m7
=========
<34 set validity:E659131B192E1853A99DE1C28CC10E14-n1.tomcat1 2048 1800 20
>34 STORED
<34 set bak:702BB50D3E55B387AC78A7182C860EB6-n2.tomcat1 2050 3600 6308
>34 STORED
<34 set bak:validity:702BB50D3E55B387AC78A7182C860EB6-n2.tomcat1 2048 1800 20
>34 STORED
<34 add lock:E659131B192E1853A99DE1C28CC10E14-n1.tomcat1 0 5 6
>34 STORED
<34 get E659131B192E1853A99DE1C28CC10E14-n1.tomcat1
>34 END
<34 delete lock:E659131B192E1853A99DE1C28CC10E14-n1.tomcat1
>34 DELETED
<34 set 3A7C2E63CD1A712F403EF78370424039-n1.tomcat1 2050 3600 6269
>34 STORED
<34 set validity:3A7C2E63CD1A712F403EF78370424039-n1.tomcat1 2048 1800 20
>34 STORED
<34 set 30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1 2050 3600 6347
>34 STORED
<34 set validity:30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1 2048 1800 20
>34 STORED
35: Client using the ascii protocol
<35 get ping-n1
>35 END
<35 get ping-n1
>35 END
<35 add lock:B13619494440EB26B72524D92A0BF38D-n1.tomcat1 0 5 6
>35 STORED
<35 add lock:B13619494440EB26B72524D92A0BF38D-n1.tomcat1 0 5 6
>35 NOT_STORED
<35 get B13619494440EB26B72524D92A0BF38D-n1.tomcat1
>35 END
<35 delete lock:B13619494440EB26B72524D92A0BF38D-n1.tomcat1
>35 DELETED
<35 add lock:B13619494440EB26B72524D92A0BF38D-n1.tomcat1 0 5 6
>35 STORED
<35 get B13619494440EB26B72524D92A0BF38D-n1.tomcat1
>35 END
<35 delete lock:B13619494440EB26B72524D92A0BF38D-n1.tomcat1
>35 DELETED
<35 add lock:30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1 0 5 6
>35 STORED
<35 get 30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1
>35 sending key 30CF04AD9139F29A7077ED6676E1233B-n1.tomcat1
>35 END
<34 set 01AD4BC6FA04FCB4921ED4B5776FA2F9-n1.tomcat1 2050 3600 6267
>34 STORED
<34 set validity:01AD4BC6FA04FCB4921ED4B5776FA2F9-n1.tomcat1 2048 1800 20
>34 STORED
<34 set DF6023986EEEA92C41C40E0439BEF0CC-n1.tomcat1 2050 3600 6341
>34 STORED
<34 set validity:DF6023986EEEA92C41C40E0439BEF0CC-n1.tomcat1 2048 1800 20
>34 STORED
<34 set E2E7A1569540C766BF1821050DD646FD-n1.tomcat1 2050 3600 6269
>34 STORED

Original issue reported on code.google.com by yoga.und...@gmail.com on 24 Mar 2014 at 11:09

GoogleCodeExporter commented 9 years ago
Tested the same behavior with simple Spring MVC application( have a single text 
field enter user id and that should be set in the Memcached server using 
JSESSION ID as a key. In this case I should see entries in memcached for only 
one KEY(JSESSIONID), but the result is different.

lxdm491m7
=========
0: Client using the ascii protocol
<30 get ping-n2
>30 END
<30 set validity:9B5C8BF8A55A37A93785F86B75DF2D0A-n2 2048 1800 20
>30 STORED
<30 get ping-n2
>30 END
<30 add lock:9B5C8BF8A55A37A93785F86B75DF2D0A-n2 0 5 6
>30 STORED
<30 get 9B5C8BF8A55A37A93785F86B75DF2D0A-n2
>30 END
<30 delete lock:9B5C8BF8A55A37A93785F86B75DF2D0A-n2
>30 DELETED

lxdm620m7
========
30: Client using the ascii protocol
<30 get ping-n1
>30 END
<30 add lock:93BEE498D754AB9FDD78A17588D3BA47-n1 0 5 6
>30 STORED
<30 get 93BEE498D754AB9FDD78A17588D3BA47-n1
>30 END
<30 delete lock:93BEE498D754AB9FDD78A17588D3BA47-n1
>30 DELETED
<30 get ping-n1
>30 END
<30 set validity:99CF07842F978BBC0556F4B12B8E9E4B-n1 2048 1800 20
>30 STORED
<30 add lock:99CF07842F978BBC0556F4B12B8E9E4B-n1 0 5 6
>30 STORED
<30 get 99CF07842F978BBC0556F4B12B8E9E4B-n1
>30 END
<30 delete lock:99CF07842F978BBC0556F4B12B8E9E4B-n1
>30 DELETED
<30 set validity:CD7B4FFE0084FDF273B3F5003185470F-n1 2048 1800 20
>30 STORED

Could you please suggest what would be wrong in my settings.

Note: Here I have only one webapp, deployed with simple mvc.

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
            sticky="false"
            memcachedNodes="n1:lxdm620m7:11211,n2:lxdm491m7:11211"
            lockingMode="all"
            requestUriIgnorePattern=".*\.(png|gif|jpg|css|js|ico)$"
            sessionBackupAsync="false"
            sessionBackupTimeout="1000"
            operationTimeout="5000"
    />

Original comment by yoga.und...@gmail.com on 25 Mar 2014 at 9:34

GoogleCodeExporter commented 9 years ago
My question here is why on lxdm620m7, i.e node 1(n1)  has 3 different kind of 
keys for the same JSESSION ID

93BEE498D754AB9FDD78A17588D3BA47-n1
99CF07842F978BBC0556F4B12B8E9E4B-n1
CD7B4FFE0084FDF273B3F5003185470F-n1

Original comment by yoga.und...@gmail.com on 25 Mar 2014 at 9:42

GoogleCodeExporter commented 9 years ago
Also the one in lxdm491m7  (n2) is different, 9B5C8BF8A55A37A93785F86B75DF2D0A. 
So totally 4 keys got created for the same JSESSION ID. Please provide some 
insight here. May be I'm wrong.

Original comment by yoga.und...@gmail.com on 25 Mar 2014 at 9:44

GoogleCodeExporter commented 9 years ago
Can you start from scratch by deleting all cookies for this host (e.g. use 
chrome dev tools), and then inspect the http headers for each request to see 
when which cookies are set?

You can try to configure storageKeyPrefix="context", see docs at
https://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration#O
verview_over_memcached-session-manager_configuration_attributes

Original comment by martin.grotzke on 27 Mar 2014 at 7:54

GoogleCodeExporter commented 9 years ago
Yes, the stale cookie was causing this issue, now I see only one key is getting 
created for each JSESSIONID.

Thanks
Yoga

Original comment by yoga.und...@gmail.com on 27 Mar 2014 at 6:29

GoogleCodeExporter commented 9 years ago
Ok, good.

Original comment by martin.grotzke on 27 Mar 2014 at 8:11