zookeeper 1.2.11 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ v1.2.12 improve locking in dispatch_next_callback
2
+
3
+ * Possible fix for an edgy NoMethodError on nil
4
+
1
5
  v1.2.11 remove dependency on backports gem
2
6
 
3
7
  * Somewhat naively we were requiring the backports gem to provide
data/Gemfile CHANGED
@@ -21,9 +21,8 @@ platform :mri_19 do
21
21
  end
22
22
 
23
23
  group :docs do
24
- gem 'yard', '~> 0.8.0'
25
-
26
24
  platform :mri_19 do
25
+ gem 'yard', '~> 0.8.0'
27
26
  gem 'redcarpet'
28
27
  end
29
28
  end
@@ -118,14 +118,30 @@ private
118
118
  hash[:stat] = Zookeeper::Stat.new(hash[:stat]) if hash.has_key?(:stat)
119
119
  hash[:acl] = hash[:acl].map { |acl| Zookeeper::ACLs::ACL.new(acl) } if hash[:acl]
120
120
 
121
- callback_context = is_completion ? get_completion(hash[:req_id]) : get_watcher(hash[:req_id])
122
-
123
- # When connectivity to the server has been lost (as indicated by SESSION_EVENT)
124
- # we want to rerun the callback at a later time when we eventually do have
125
- # a valid response.
126
- if hash[:type] == Zookeeper::Constants::ZOO_SESSION_EVENT
127
- # XXX: setup_completion changed arity, is this setup_completion necessary anymore?
128
- is_completion ? setup_completion(hash[:req_id], callback_context) : setup_watcher(hash[:req_id], callback_context)
121
+ callback_context = nil
122
+
123
+ @mutex.synchronize do
124
+ callback_context = is_completion ? get_completion(hash[:req_id]) : get_watcher(hash[:req_id])
125
+
126
+ # When connectivity to the server has been lost (as indicated by SESSION_EVENT)
127
+ # we want to rerun the callback at a later time when we eventually do have
128
+ # a valid response.
129
+ #
130
+ # XXX: this code needs to be refactored, get_completion shouldn't remove the context
131
+ # in the case of a session event. this would involve changing the
132
+ # platform implementations as well, as the C version does some funky
133
+ # stuff to maintain compatibilty w/ java in chrooted envs.
134
+ #
135
+ # The point is that this lock ^^ is unnecessary if the functions above lock internally
136
+ # and don't do the wrong thing, requiring us to do the below.
137
+ #
138
+ if hash[:type] == Zookeeper::Constants::ZOO_SESSION_EVENT
139
+ if is_completion
140
+ setup_completion(hash[:req_id], callback_context)
141
+ else
142
+ setup_watcher(hash[:req_id], callback_context)
143
+ end
144
+ end
129
145
  end
130
146
 
131
147
  if callback_context
@@ -9,9 +9,9 @@ module Exceptions
9
9
  CONST_MISSING_WARNING = <<-EOS
10
10
 
11
11
  ------------------------------------------------------------------------------------------
12
- WARNING! THE ZOOKEEPER NAMESPACE HAS CHNAGED AS OF 1.0!
12
+ WARNING! THE ZOOKEEPER NAMESPACE HAS CHANGED AS OF 1.0!
13
13
 
14
- Please update your code to use the new heirarchy!
14
+ Please update your code to use the new hierarchy!
15
15
 
16
16
  The constant that got you this was ZookeeperExceptions::ZookeeperException::%s
17
17
 
@@ -1,4 +1,4 @@
1
1
  module Zookeeper
2
- VERSION = '1.2.11'
2
+ VERSION = '1.2.12'
3
3
  DRIVER_VERSION = '3.3.5'
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zookeeper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 11
10
- version: 1.2.11
9
+ - 12
10
+ version: 1.2.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phillip Pearson
@@ -20,7 +20,7 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2012-07-18 00:00:00 Z
23
+ date: 2012-07-26 00:00:00 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: logging
@@ -177,4 +177,3 @@ test_files:
177
177
  - spec/support/progress_formatter.rb
178
178
  - spec/support/zookeeper_spec_helpers.rb
179
179
  - spec/zookeeper_spec.rb
180
- has_rdoc: