Patches: Browse | Submit New | Admin

[#6220] [memcache-client] Add support for an auto reconnect if the socket is a dud

Date:
2006-10-18 22:20
Priority:
3
Submitted By:
Ian Leitch (idl)
Assigned To:
Eric Hodel (drbrain)
Category:
None
State:
Open
Summary:
[memcache-client] Add support for an auto reconnect if the socket is a dud

Detailed description
If the memcached server goes down for whatever reason, yet comes back straight away (server restart etc) the client
socket will raise Broken pipe errors. I didn't notice any supported away to handle this, and I didn't want to messy
up my code with trying to reconnect, so I've added the ability for an auto reconnect when a Broken pipe error is raised.
There may be other IOError types it should catch too.

As for the unit test, I'm not sure how to write it as it'd require a prompt for the user to manually to restart their
memcached server or something?

Add A Comment: Notepad

Please login


Followup

Message
Date: 2006-12-07 23:12
Sender: Eric Hodel

I've looked at your patch, and it won't work as is.

Errno::EPIPE is a subclass of SystemCallError.  Rescuing exceptions
by message name is fragile, and not to be done.

I've tried an alternate implementation, but I've not yet gotten
something acceptable.

I am working on attempting to reconnect once, then failing.

Attached Files:

Name Description Download
memcache-auto-reconnect.patch Download
test_mem_cache-auto-reconnect.patch Download

Changes:

Field Old Value Date By
assigned_tonone2006-12-07 23:12drbrain
File Added868: test_mem_cache-auto-reconnect.patch2006-10-18 22:21idl
File Added867: memcache-auto-reconnect.patch2006-10-18 22:21idl