This project is archived and is in readonly mode.
ActiveSupport::Cache::MemCacheStore connection to MemCached becomes corrupted with invalid :expires_in
Reported by ekolve | June 29th, 2009 @ 09:21 PM | in 2.x
If the following code is run the first write succeeds, but the last two calls output an error in the logs:
Cache write: foo
Cache read: foo
Cache write: mynewfoo ({:expires_in=>"Mon Jun 29 13:10:40 -0700
2009"})
MemCacheError ():
Cache read: foo
MemCacheError ():
The invalid expires_in corrupts the connection to MemCache. The simplest fix to this would be to call reset on the connection to memcache and retrieve a new connection if a MemCache exception is rescued.
cache = ActiveSupport::Cache::MemCacheStore.new("localhost:11211")
cache.write("foo", "bar")
puts cache.read("foo").inspect # outputs foo
cache.write("mynewfoo", "blah", :expires_in => 'Mon Jun 29 13:10:40 -0700 2009')
puts cache.read("foo").inspect # outputs nil
Comments and changes to this ticket
-
Repository July 2nd, 2009 @ 01:02 AM
- State changed from new to resolved
(from [ee7d4c47e7abf1e5ec8f4d4a1e937cdee5bb8d9c]) Fixes bug where Memcached connections get corrupted when an invalid expire is passed in [#2854 state:resolved] http://github.com/rails/rails/commit/ee7d4c47e7abf1e5ec8f4d4a1e937c...
-
Repository July 2nd, 2009 @ 01:02 AM
(from [4d8fd8d33568d8db9fc7a2c0bc2e11ca67c77987]) Fixes bug where Memcached connections get corrupted when an invalid expire is passed in [#2854 state:resolved] http://github.com/rails/rails/commit/4d8fd8d33568d8db9fc7a2c0bc2e11...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 2854 ActiveSupport::Cache::MemCacheStore connection to MemCached becomes corrupted with invalid :expires_in (from [ee7d4c47e7abf1e5ec8f4d4a1e937cdee5bb8d9c]) Fixes b...
- 2854 ActiveSupport::Cache::MemCacheStore connection to MemCached becomes corrupted with invalid :expires_in (from [4d8fd8d33568d8db9fc7a2c0bc2e11ca67c77987]) Fixes b...