This project is archived and is in readonly mode.
MemCacheStore does not work with Memcached::Rails
Reported by ronin-41535 (at lighthouseapp) | January 8th, 2010 @ 10:20 PM
Lines 43-46 of
activesupport/lib/active_support/cache/mem_cache_store.rb
read:
# Instead of addresses one can pass in a MemCache-like object. For example:
#
# require 'memcached' # gem install memcached; uses C bindings to libmemcached
# ActiveSupport::Cache::MemCacheStore.new(Memcached::Rails.new("localhost:11211"))
However, actually trying to do this raises an
ArgumentError ("wrong number of arguments (2 for 1)")
since Memcached::Rails#delete
(introduced in
http://github.com/fauna/memcached/commit/0a5df4124076af585e726a372b...)
only takes one argument.
Since memcached has deprecated support for an expiry on the
delete operation in version 1.4, the memcache-client
gem's MemCache#delete
method ignores it in edge as
well (as explained at
http://github.com/mperham/memcache-client/blob/master/lib/memcache.....
In previous versions, it provides a default argument value for
expiry, so it supports calling the delete method with just the
key.
Therefore, calling @data.delete(key)
in
MemCacheStore#delete
is safe for usage with the
memcache-client
gem, and makes it usable with the
memcached
gem, as advertised (but not currently the
case).
This patch adds a test that the underlying implementation is only called with one argument (the key) and changes the call.
Comments and changes to this ticket
-
ronin-41535 (at lighthouseapp) January 8th, 2010 @ 11:03 PM
- Tag changed from memcachestore to memcachestore, patch
-
Gus January 8th, 2010 @ 11:36 PM
Makes sense to me. Let's bring the whole enchilada in line with reality.
-
clay January 15th, 2010 @ 09:53 PM
+3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160
-
ronin-41535 (at lighthouseapp) March 2nd, 2010 @ 08:29 PM
Are there any problems with the patch, bug report, or anything else with this ticket? Or is there some other reason that it's being ignored?
-
Repository March 28th, 2010 @ 09:57 PM
- State changed from new to resolved
(from [edaf92f5ab4b44e789e526dfa8b93cb370e595cf]) Drop expires argument from call to @data in MemCacheStore so it works with memcache-client and memcached gems, as advertised [#3672 state:resolved]
Signed-off-by: wycats wycats@gmail.com
http://github.com/rails/rails/commit/edaf92f5ab4b44e789e526dfa8b93c...
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
Attachments
Tags
Referenced by
- 3672 MemCacheStore does not work with Memcached::Rails (from [edaf92f5ab4b44e789e526dfa8b93cb370e595cf]) Drop ex...