Application (memcached client) can not continue to usethememcached instances after a memcached restart ...(theapplication itself is not restarted)

Kieran Benton kieran.benton at
Fri Jan 11 08:57:20 UTC 2008

This has niggled with me for a while as well :) maybe its best that if we just detect a "connection reset" socket error code we swallow the error with stack and just log a one line warning?

This message was sent by Blackberry

-----Original Message-----
From: memcached-bounces at <memcached-bounces at>
To: a. <a at>
CC: memcached at <memcached at>
Sent: Fri Jan 11 08:35:21 2008
Subject: Re: Application (memcached client) can not continue to usethememcached instances after a memcached restart ...(theapplication itself is not restarted)

On Jan 10, 2008 11:54 PM, a. <a at> wrote:

	I'm the author of the client you're using.
	When the service is restarted all connections in the pool become
	invalid, so next time you try to do something with memcached the
	client will fail. This exception should be hidden though and the 
	server should be marked as "dead" for a (configurable) period of time.
	So probably this exception is not hidden enough and you're hitting a
	bug :)
	Please send me the stack trace of the exception and i'll look into it. 
	In the meanwhile you might wanna try out the latest version of the
	client (available in source on codeplex)

Fwiw, I'm running the same test scenarios myself with your client [latest code] (with my patches admittedly) and although these exceptions do occur (they occur on the GetOperation.ExecuteAction() method), they don't bubble.  They're logged out immediately and the flow of execution continues as if the action had executed successfully (obviously the returned cache value is null).  

This seems like valid behaviour to me, although I guess technically I would prefer an ObjectReferenceNotFoundException wasn't thrown and then caught where possible as it makes my logs look quite ugly ;)

- Ciaran


	On Jan 11, 2008, at 12:29 AM, Kiran Bhogadi wrote:
	> Hello folks!
	> I am playing around with memcached and I have a question based on
	> the following scenario. 
	> Before I describe my scenario, here's the info on my setup:
	> i)  memcached 1.2.1 on Windows XP
	> ii) Using a C# Memcached Client (Enyim.Caching)
	> Here's a simplified scenario for the sake of description ... 
	> 1) App A is configured to use memcached instances M1, M2.
	> 2) App A is started and it starts storing/getting objects to/from
	> memcached. Then App A takes a little break from using memcached :) 
	> 3) Memcached instances M1, M2 are stopped and re-started, while app
	> A continues to run.
	> 4) The next time App A tries to use the restarted memcached (M1 or
	> M2) there is an error/exception. 
	> 5) If I stop and start (i.e., restart) App A itself, then it works
	> okay again with memcached instances M1 and M2.
	> My concern is with (4) above.
	> Is (4) just an artifact of the client API we are using that App A 
	> fails to use memcached instances after the memcached restart?
	> (Perhaps, someone using Enyim.Caching C# API can answer this - maybe
	> there is a way to configure the client so that it won't fail during 
	> (4)?) I am looking into the Enyim.Caching   code to see what I need
	> to change in order to change the behavior seen in (4). But I am
	> hoping there may be a solution already out there for this ...  :) 
	> Any helpful ideas on this issue [even if you are using a different
	> type of memcached client] are appreciated.
	> Best Regards,
	> Kiran

- Ciaran 
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list