memcached 0.7 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +3 -1
- data/lib/memcached/memcached.rb +7 -6
- data/lib/memcached/rails.rb +4 -0
- data/memcached.gemspec +2 -2
- data/test/unit/memcached_test.rb +9 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
|
2
|
-
v0.7.
|
2
|
+
v0.7.1. Allow for explicit resetting of the struct on each request, at least until Brian fixes the synchronization problem.
|
3
|
+
|
4
|
+
v0.7. Rails compatibility wrapper; real multiget; rescue UnknownReadFailures in order to reset the struct..
|
3
5
|
|
4
6
|
v0.6. Better documentation; benchmark suite; improve buffered IO API; remove namespace accessor in favor of generic options hash; patch up extconf.rb to handle unusual library situations; increase test coverage.
|
5
7
|
|
data/lib/memcached/memcached.rb
CHANGED
@@ -113,6 +113,13 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
+
# Reset the state of the libmemcached struct. Fixes out-of-sync errors with the Memcached pool.
|
117
|
+
def reset
|
118
|
+
new_struct = Rlibmemcached.memcached_clone(nil, @struct)
|
119
|
+
Rlibmemcached.memcached_free(@struct)
|
120
|
+
@struct = new_struct
|
121
|
+
end
|
122
|
+
|
116
123
|
#:stopdoc:
|
117
124
|
alias :dup :clone #:nodoc:
|
118
125
|
#:startdoc:
|
@@ -316,12 +323,6 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|
316
323
|
# 0.14 returns 0 for an ActionQueued result but 0.15 does not.
|
317
324
|
return if ret == 0 or ret == 31
|
318
325
|
raise EXCEPTIONS[ret], ""
|
319
|
-
rescue UnknownReadFailure
|
320
|
-
# libmemcached got out of sync; rebuild the struct
|
321
|
-
new_struct = Rlibmemcached.memcached_clone(nil, @struct)
|
322
|
-
Rlibmemcached.memcached_free(@struct)
|
323
|
-
@struct = new_struct
|
324
|
-
raise SynchronizationError, "Rebuilding @struct"
|
325
326
|
end
|
326
327
|
|
327
328
|
end
|
data/lib/memcached/rails.rb
CHANGED
@@ -4,6 +4,10 @@ class Memcached
|
|
4
4
|
alias :get_multi :get #:nodoc:
|
5
5
|
|
6
6
|
# A legacy compatibility wrapper for the Memcached class. It has basic compatibility with the <b>memcache-client</b> API.
|
7
|
+
#
|
8
|
+
# There is currently a libmemcached stability issue with long-lived instances, so you will want to call Memcached#reset before each
|
9
|
+
# request (for example, in an ActionController filter).
|
10
|
+
#
|
7
11
|
class Rails < ::Memcached
|
8
12
|
|
9
13
|
DEFAULTS = {}
|
data/memcached.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Memcached-0.7
|
2
|
+
# Gem::Specification for Memcached-0.7.1
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{memcached}
|
7
|
-
s.version = "0.7"
|
7
|
+
s.version = "0.7.1"
|
8
8
|
|
9
9
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
10
10
|
|
data/test/unit/memcached_test.rb
CHANGED
@@ -458,6 +458,15 @@ class MemcachedTest < Test::Unit::TestCase
|
|
458
458
|
threads.each {|thread| thread.join}
|
459
459
|
end
|
460
460
|
|
461
|
+
def test_reset
|
462
|
+
original_struct = @cache.instance_variable_get("@struct")
|
463
|
+
assert_nothing_raised do
|
464
|
+
@cache.reset
|
465
|
+
end
|
466
|
+
assert_not_equal original_struct,
|
467
|
+
@cache.instance_variable_get("@struct")
|
468
|
+
end
|
469
|
+
|
461
470
|
private
|
462
471
|
|
463
472
|
def key
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|