de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession WARNING: An error when trying to load/update validity info.

620 views
Skip to first unread message

严细浪

unread,
Aug 10, 2012, 5:41:32 AM8/10/12
to memcached-se...@googlegroups.com
I am using spymemcached-2.7.3,memcached-session-manager-tc7-1.6.2, memcached-session-manager-1.6.2

My configuration is below;
 <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" 
        memcachedNodes="localhost:11211" 
        requestUriIgnorePattern=".*\.(png|gif|jpg|css|js)$" 
        sticky="false"
        sessionBackupAsync="false" 
        sessionBackupTimeout="10000" 
        operationTimeout="10000"
        enableStatistics="false"
      />
Then it will get below exception. All I know is the connection to memecached server will lost every 20 minutes, and seems the exception happens after connection dropped.
I want to know if I can do some configuration to avoid this error.

Aug 10, 2012 4:22:23 AM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession
WARNING: An error when trying to load/update validity info.
java.lang.RuntimeException: Exception waiting for value
    at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1183)
    at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1200)
    at de.javakaffee.web.msm.LockingStrategy.loadSessionValidityInfoForValidityKey(LockingStrategy.java:337)
    at de.javakaffee.web.msm.LockingStrategy.onBackupWithoutLoadedSession(LockingStrategy.java:228)
    at de.javakaffee.web.msm.MemcachedSessionService.backupSession(MemcachedSessionService.java:1031)
    at de.javakaffee.web.msm.RequestTrackingHostValve.backupSession(RequestTrackingHostValve.java:229)
    at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:154)
    at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:151)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Cancelled
    at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:84)
    at net.spy.memcached.internal.GetFuture.get(GetFuture.java:38)
    at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1178)
    ... 18 more
Caused by: java.lang.RuntimeException: Cancelled
    ... 21 more

Martin Grotzke

unread,
Aug 12, 2012, 11:16:30 PM8/12/12
to memcached-se...@googlegroups.com

The msm configuration looks good, especially the high operation timeout should support bad memcached connectivity. Is there anything special regarding the connection, e.g. some firewall in between that might drop connections after a certain amount of time?
You might also check memcached configuration and stats, e.g. max memory and evictions.

Btw, sorry for the long delay (of publishing your post), but I'm just on vacation without regular internet connectivity.

Cheers,
Martin

严细浪

unread,
Aug 13, 2012, 5:50:31 AM8/13/12
to memcached-se...@googlegroups.com, martin....@googlemail.com
I am testing a new Azure feature, it's not a memcached server but a memcached wrapper, when I telnet to the server, the connection will also dropped after about 20 minutes. Microsoft have known the issue and they are following why the connection will be dropped.

At the same time, I am wonder If I can do some configuration to avoid the exception. It will be great if it can auto re-connect to memcached server, and the most important, it should not cancel the request(I don't know why the request is cancelled), as it will make a new tomcat session created.

This is my first time submit topic here, thanks for your quick response.

Martin Grotzke

unread,
Aug 13, 2012, 1:34:40 PM8/13/12
to memcached-session-manager

Auto reconnection to memcached server would have to base done by spymemcached, the memcached client used by msm. You can check this on their mailing list.

Cheers,
Martin

严细浪

unread,
Aug 13, 2012, 8:50:40 PM8/13/12
to memcached-se...@googlegroups.com, martin....@googlemail.com
Ok, I will check it there.

BTW, from the log, I see one request is cancelled, does memcached-session-manager do anything to cancel the request or the request is cancelled by spymemcached?

Martin Grotzke

unread,
Aug 14, 2012, 1:49:20 AM8/14/12
to memcached-session-manager

That's all done by spymemcached, msm only sets the timeout for a request.

Cheers,
Martin

Marcos NiLs

unread,
Nov 28, 2012, 3:33:54 PM11/28/12
to memcached-se...@googlegroups.com, martin....@googlemail.com
Hi Guys, 

I was having the same problem using memcached-session-manager and spymemcached. What I did is to change  Spymemcached FailureMode from the default one (redistribute) to "retry". That will make spymemcached to retry the operation rather than abort it and throw the error you're seing.

I had to manually make the change as msm does not support setting spymemcached FailureMode. Maybe this would be a nice feature for the future.

Hope mi answer helps.

Marcos!.

Martin Grotzke

unread,
Nov 28, 2012, 5:59:36 PM11/28/12
to memcached-se...@googlegroups.com
On 11/28/2012 09:33 PM, Marcos NiLs wrote:
> Hi Guys,
>
> I was having the same problem using memcached-session-manager and
> spymemcached. What I did is to change Spymemcached FailureMode from the
> default one (redistribute) to "retry". That will make spymemcached to
> retry the operation rather than abort it and throw the error you're seing.
Basically redistribute doesn't make sense at all. I'm suprised that this
is the default, maybe it changed in some version.


> I had to manually make the change as msm does not support setting
> spymemcached FailureMode. Maybe this would be a nice feature for the future.
Wouldn't it be sufficient just to hardcode "retry", or do you think
"cancel" would be useful in some cases?

Can you please submit an issue for this?

Thanx && cheers,
Martin


>
> Hope mi answer helps.
>
> Marcos!.
>
> El martes, 14 de agosto de 2012 02:49:20 UTC-3, Martin Grotzke escribió:
>
> That's all done by spymemcached, msm only sets the timeout for a
> request.
>
> Cheers,
> Martin
>
> usingspymemcached-2.7.3,memcached-__s__ession-manager-tc7-1.6.2,
> memcached-session-manager-1.6.____2
>
> My configuration is below;
> <Manager
> className="de.javakaffee.web.__m__sm.__MemcachedBackupSessionManag__er"__
>
> memcachedNodes="localhost:__1121__1"
>
> requestUriIgnorePattern=".*\.(____png|gif|jpg|css|js)$"
>
> sticky="false"
> sessionBackupAsync="false"
> sessionBackupTimeout="10000"
> operationTimeout="10000"
> enableStatistics="false"
> />
> Then it will get below exception. All I know is
> the connection to memecached server will lost
> every 20 minutes, and seems the exception
> happens after connection dropped.
> I want to know if I can do some configuration to
> avoid this error.
>
> Aug 10, 2012 4:22:23 AM
> de.javakaffee.web.msm.__LockingS__trategy
> onBackupWithoutLoadedSession
> WARNING: An error when trying to load/update
> validity info.
> java.lang.RuntimeException: Exception waiting
> for value
> at
> net.spy.memcached.__MemcachedCli__ent.get(__MemcachedClient.java:__1183)
> at
> net.spy.memcached.__MemcachedCli__ent.get(__MemcachedClient.java:__1200)
> at
> de.javakaffee.web.msm.__LockingS__trategy.__loadSessionValidityInf__oForVali__dityKey(__LockingStrategy.java:__337)
> at
> de.javakaffee.web.msm.__LockingS__trategy.__onBackupWithoutLoadedS__ession(__LockingStrategy.java:__228)
> at
> de.javakaffee.web.msm.__Memcache__dSessionService.__backupSession(____MemcachedSessionService.java:__1__031)
> at
> de.javakaffee.web.msm.__RequestT__rackingHostValve.__backupSession__(__RequestTrackingHostValve.__java:__229)
> at
> de.javakaffee.web.msm.__RequestT__rackingHostValve.__invoke(__Reques__tTrackingHostValve.java:__154)
> at
> de.javakaffee.web.msm.__RequestT__rackingHostValve.__invoke(__Reques__tTrackingHostValve.java:__151)
> at
> org.apache.catalina.valves.__Err__orReportValve.invoke(__ErrorRepo__rtValve.java:100)
> at
> org.apache.catalina.valves.__Acc__essLogValve.invoke(__AccessLogVa__lve.java:563)
> at
> org.apache.catalina.core.__Stand__ardEngineValve.invoke(__Standard__EngineValve.java:118)
> at
> org.apache.catalina.connector.____CoyoteAdapter.service(__CoyoteAd__apter.java:399)
> at
> org.apache.coyote.http11.__Http1__1Processor.process(__Http11Proce__ssor.java:317)
> at
> org.apache.coyote.http11.__Http1__1Protocol$__Http11ConnectionHand__ler.__process(Http11Protocol.__java:__204)
> at
> org.apache.coyote.http11.__Http1__1Protocol$__Http11ConnectionHand__ler.__process(Http11Protocol.__java:__182)
> at org.apache.tomcat.util.net
> <http://org.apache.tomcat.util.net>.__JIo__Endpoint$SocketProcessor.__run(__JIoEndpoint.java:311)
> at
> java.util.concurrent.__ThreadPoo__lExecutor$Worker.__runTask(__ThreadPoolExecutor.__java:886)
> at
> java.util.concurrent.__ThreadPoo__lExecutor$Worker.run(__ThreadPoo__lExecutor.java:908)
> at java.lang.Thread.run(Thread.__ja__va:619)
> Caused by:
> java.util.concurrent.__Execution__Exception:
> java.lang.RuntimeException: Cancelled
> at
> net.spy.memcached.internal.__Ope__rationFuture.get(__OperationFutu__re.java:84)
> at
> net.spy.memcached.internal.__Get__Future.get(GetFuture.java:__38)
> at
> net.spy.memcached.__MemcachedCli__ent.get(__MemcachedClient.java:__1178)
> ... 18 more
> Caused by: java.lang.RuntimeException: Cancelled
> ... 21 more
>

--
inoio gmbh - http://inoio.de
Breitenfelder Str. 13c, 20251 Hamburg
Amtsgericht Hamburg, HRB 123031
Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn

signature.asc

Marcos Lilljedahl

unread,
Nov 28, 2012, 6:05:41 PM11/28/12
to memcached-se...@googlegroups.com
On Wed, Nov 28, 2012 at 7:59 PM, Martin Grotzke <martin....@googlemail.com> wrote:
On 11/28/2012 09:33 PM, Marcos NiLs wrote:
> Hi Guys,
>
> I was having the same problem using memcached-session-manager and
> spymemcached. What I did is to change  Spymemcached FailureMode from the
> default one (redistribute) to "retry". That will make spymemcached to
> retry the operation rather than abort it and throw the error you're seing.
Basically redistribute doesn't make sense at all. I'm suprised that this
is the default, maybe it changed in some version.

 
> I had to manually make the change as msm does not support setting
> spymemcached FailureMode. Maybe this would be a nice feature for the future.
Wouldn't it be sufficient just to hardcode "retry", or do you think
"cancel" would be useful in some cases?

I think the FailureMode mode depends on the application logic. The retry option may cause low response times as the driver will retry the operation several times before returning a response. My suggest would be to include it as another configuration parameter with "retry" as default.

Can you please submit an issue for this?

Sure.  

Martin Grotzke

unread,
Nov 28, 2012, 6:30:21 PM11/28/12
to memcached-se...@googlegroups.com
Ok, thanx!

Of course if you like you can also submit a pull request :-)

Cheers,
Martin


On 11/29/2012 12:05 AM, Marcos Lilljedahl wrote:
>
>
>
> On Wed, Nov 28, 2012 at 7:59 PM, Martin Grotzke
> <martin....@googlemail.com <mailto:martin....@googlemail.com>>
> <mailto:xilan...@gmail.com> <javascript:>>:
> >
> > Ok, I will check it there.
> >
> > BTW, from the log, I see one request is cancelled, does
> > memcached-session-manager do anything to cancel the request or
> > the request is cancelled by spymemcached?
> >
> > On Tuesday, August 14, 2012 1:34:40 AM UTC+8, Martin
> Grotzke wrote:
> >
> > Auto reconnection to memcached server would have to base
> > done by spymemcached, the memcached client used by
> msm. You
> > can check this on their mailing list.
> >
> > Cheers,
> > Martin
> >
> > Am 13.08.2012 03:50 schrieb "严细浪"
> <xilan...@gmail.com <mailto:xilan...@gmail.com>>:
> > <xilan...@gmail.com <mailto:xilan...@gmail.com>>:
signature.asc
Reply all
Reply to author
Forward
0 new messages