zookeeper 1.4.11 → 1.5.3

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.
@@ -0,0 +1,16 @@
1
+ diff -ur zkc-3.4.5-orig/c/src/mt_adaptor.c zkc-3.4.5/c/src/mt_adaptor.c
2
+ --- zkc-3.4.5-orig/c/src/mt_adaptor.c 2012-09-30 10:53:32.000000000 -0700
3
+ +++ zkc-3.4.5/c/src/mt_adaptor.c 2016-09-07 16:55:13.787553837 -0700
4
+ @@ -484,11 +484,7 @@
5
+ {
6
+ #ifndef WIN32
7
+ int32_t result;
8
+ - asm __volatile__(
9
+ - "lock xaddl %0,%1\n"
10
+ - : "=r"(result), "=m"(*(int *)operand)
11
+ - : "0"(incr)
12
+ - : "memory");
13
+ + result = __sync_fetch_and_add(operand, incr);
14
+ return result;
15
+ #else
16
+ volatile int32_t result;
data/ext/zkrb.c CHANGED
@@ -203,7 +203,6 @@ inline static int we_are_forked(zkrb_instance_data_t *zk) {
203
203
  return rv;
204
204
  }
205
205
 
206
-
207
206
  static int destroy_zkrb_instance(zkrb_instance_data_t* zk) {
208
207
  int rv = ZOK;
209
208
 
@@ -245,6 +244,11 @@ static void free_zkrb_instance_data(zkrb_instance_data_t* ptr) {
245
244
  destroy_zkrb_instance(ptr);
246
245
  }
247
246
 
247
+ VALUE alloc_zkrb_instance(VALUE klass) {
248
+ zkrb_instance_data_t* zk = ZALLOC_N(zkrb_instance_data_t, 1);
249
+ return Data_Wrap_Struct(klass, NULL, free_zkrb_instance_data, zk);
250
+ }
251
+
248
252
  static void print_zkrb_instance_data(zkrb_instance_data_t* ptr) {
249
253
  fprintf(stderr, "zkrb_instance_data (%p) {\n", ptr);
250
254
  fprintf(stderr, " zh = %p\n", ptr->zh);
@@ -1013,7 +1017,7 @@ static void zkrb_define_methods(void) {
1013
1017
  DEFINE_METHOD(close_handle, 0);
1014
1018
  DEFINE_METHOD(deterministic_conn_order, 1);
1015
1019
  DEFINE_METHOD(is_unrecoverable, 0);
1016
- DEFINE_METHOD(recv_timeout, 1);
1020
+ DEFINE_METHOD(recv_timeout, 0);
1017
1021
  DEFINE_METHOD(zkrb_state, 0);
1018
1022
  DEFINE_METHOD(sync, 2);
1019
1023
  DEFINE_METHOD(zkrb_iterate_event_loop, 0);
@@ -1063,6 +1067,7 @@ void Init_zookeeper_c() {
1063
1067
 
1064
1068
  /* initialize CZookeeper class */
1065
1069
  CZookeeper = rb_define_class_under(mZookeeper, "CZookeeper", rb_cObject);
1070
+ rb_define_alloc_func(CZookeeper, alloc_zkrb_instance);
1066
1071
  zkrb_define_methods();
1067
1072
 
1068
1073
  ZookeeperClientId = rb_define_class_under(CZookeeper, "ClientId", rb_cObject);
data/java/java_base.rb CHANGED
@@ -183,13 +183,11 @@ class JavaBase
183
183
  attr_reader :event_queue
184
184
 
185
185
  def reopen(timeout=10, watcher=nil, opts = {})
186
- # watcher ||= @default_watcher
187
-
188
186
  @mutex.synchronize do
189
187
  @req_registry.clear_watchers!
190
188
 
191
189
  replace_jzk!(opts)
192
- wait_until_connected
190
+ wait_until_connected(timeout)
193
191
  end
194
192
 
195
193
  state
@@ -490,7 +488,7 @@ class JavaBase
490
488
 
491
489
  def replace_jzk!(opts = {})
492
490
  orig_jzk = @jzk
493
- if opts.has_key?(:session_id) && opts.has_key(:session_passwd)
491
+ if opts.has_key?(:session_id) && opts.has_key?(:session_passwd)
494
492
  @jzk = JZK::ZooKeeper.new(@host, DEFAULT_SESSION_TIMEOUT, JavaCB::WatcherCallback.new(event_queue, :client => self), opts.fetch(:session_id), opts.fetch(:session_passwd).to_java_bytes)
495
493
  else
496
494
  @jzk = JZK::ZooKeeper.new(@host, DEFAULT_SESSION_TIMEOUT, JavaCB::WatcherCallback.new(event_queue, :client => self))
@@ -1,4 +1,4 @@
1
1
  module Zookeeper
2
- VERSION = '1.4.11'
2
+ VERSION = '1.5.3'
3
3
  DRIVER_VERSION = '3.4.5'
4
4
  end
@@ -4,7 +4,7 @@ unless defined?(::JRUBY_VERSION)
4
4
  describe %[forked connection] do
5
5
  let(:path) { "/_zktest_" }
6
6
  let(:pids_root) { "#{path}/pids" }
7
- let(:data) { "underpants" }
7
+ let(:data) { "underpants" }
8
8
  let(:connection_string) { Zookeeper.default_cnx_str }
9
9
 
10
10
  def process_alive?(pid)
@@ -15,7 +15,7 @@ unless defined?(::JRUBY_VERSION)
15
15
  end
16
16
 
17
17
  LBORDER = ('-' * 35) << '< '
18
- RBORDER = ' >' << ('-' * 35)
18
+ RBORDER = ' >' << ('-' * 35)
19
19
 
20
20
  def mark(thing)
21
21
  logger << "\n#{LBORDER}#{thing}#{RBORDER}\n\n"
@@ -25,8 +25,6 @@ unless defined?(::JRUBY_VERSION)
25
25
  mark "BEFORE: START"
26
26
  if defined?(::Rubinius)
27
27
  pending("this test is currently broken in rbx")
28
- # elsif ENV['TRAVIS']
29
- # pending("this test is currently hanging in travis")
30
28
  else
31
29
  @zk = Zookeeper.new(connection_string)
32
30
  rm_rf(@zk, path)
@@ -105,7 +103,7 @@ unless defined?(::JRUBY_VERSION)
105
103
  @zk.resume_after_fork_in_parent
106
104
 
107
105
  event_waiter_th = Thread.new do
108
- @latch.await(5) unless @event
106
+ @latch.await(5) unless @event
109
107
  @event
110
108
  end
111
109
 
@@ -1051,7 +1051,11 @@ shared_examples_for "connection" do
1051
1051
  zk.close
1052
1052
  end
1053
1053
 
1054
- zk.stat(:path => path, :callback => evil_cb)
1054
+ begin
1055
+ zk.stat(:path => path, :callback => evil_cb)
1056
+ rescue IOError
1057
+ # captures flaky IOError: stream closed in another thread
1058
+ end
1055
1059
 
1056
1060
  wait_until { zk.closed? }
1057
1061
  zk.should be_closed
@@ -3,10 +3,6 @@ module Zookeeper
3
3
  !!ENV['SPAWN_ZOOKEEPER']
4
4
  end
5
5
 
6
- def self.travis?
7
- !!ENV['TRAVIS']
8
- end
9
-
10
6
  def self.default_cnx_host
11
7
  ENV['ZK_DEFAULT_HOST'] || 'localhost'
12
8
  end
data/zookeeper.gemspec CHANGED
@@ -6,13 +6,21 @@ Gem::Specification.new do |s|
6
6
  s.name = 'zookeeper'
7
7
  s.version = Zookeeper::VERSION
8
8
 
9
- s.authors = ["Phillip Pearson", "Eric Maland", "Evan Weaver", "Brian Wickman", "Neil Conway", "Jonathan D. Simms"]
9
+ s.authors = [
10
+ "Phillip Pearson",
11
+ "Eric Maland",
12
+ "Evan Weaver",
13
+ "Brian Wickman",
14
+ "Neil Conway",
15
+ "Jonathan D. Simms",
16
+ "Mal McKay",
17
+ ]
10
18
  s.email = ["slyphon@gmail.com"]
11
19
  s.summary = %q{Apache ZooKeeper driver for Rubies}
12
20
  s.description = <<-EOS
13
21
  A low-level multi-Ruby wrapper around the ZooKeeper API bindings. For a
14
22
  friendlier interface, see http://github.com/slyphon/zk. Currently supported:
15
- MRI: {1.8.7, 1.9.2, 1.9.3}, JRuby: ~> 1.6.7, Rubinius: 2.0.testing, REE 1.8.7.
23
+ MRI: {2.5, 2.6, 2.7, 3.0}, JRuby: ~> 9.2.x.x
16
24
 
17
25
  This library uses version #{Zookeeper::DRIVER_VERSION} of zookeeper bindings.
18
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zookeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.11
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phillip Pearson
@@ -10,23 +10,19 @@ authors:
10
10
  - Brian Wickman
11
11
  - Neil Conway
12
12
  - Jonathan D. Simms
13
- autorequire:
13
+ - Mal McKay
14
+ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2015-09-28 00:00:00.000000000 Z
17
+ date: 2022-07-18 00:00:00.000000000 Z
17
18
  dependencies: []
18
- description: ! 'A low-level multi-Ruby wrapper around the ZooKeeper API bindings.
19
- For a
20
-
19
+ description: |+
20
+ A low-level multi-Ruby wrapper around the ZooKeeper API bindings. For a
21
21
  friendlier interface, see http://github.com/slyphon/zk. Currently supported:
22
-
23
- MRI: {1.8.7, 1.9.2, 1.9.3}, JRuby: ~> 1.6.7, Rubinius: 2.0.testing, REE 1.8.7.
24
-
22
+ MRI: {2.5, 2.6, 2.7, 3.0}, JRuby: ~> 9.2.x.x
25
23
 
26
24
  This library uses version 3.4.5 of zookeeper bindings.
27
25
 
28
-
29
- '
30
26
  email:
31
27
  - slyphon@gmail.com
32
28
  executables: []
@@ -34,13 +30,13 @@ extensions:
34
30
  - ext/extconf.rb
35
31
  extra_rdoc_files: []
36
32
  files:
37
- - .ctags_paths
38
- - .dotfiles/ruby-gemset
39
- - .dotfiles/ruby-version
40
- - .dotfiles/rvmrc
41
- - .gitignore
42
- - .gitmodules
43
- - .travis.yml
33
+ - ".ctags_paths"
34
+ - ".dotfiles/ruby-gemset"
35
+ - ".dotfiles/ruby-version"
36
+ - ".dotfiles/rvmrc"
37
+ - ".github/workflows/build.yml"
38
+ - ".gitignore"
39
+ - ".gitmodules"
44
40
  - CHANGELOG
45
41
  - Gemfile
46
42
  - Guardfile
@@ -60,6 +56,9 @@ files:
60
56
  - ext/extconf.rb
61
57
  - ext/generate_gvl_code.rb
62
58
  - ext/patches/zkc-3.3.5-network.patch
59
+ - ext/patches/zkc-3.4.5-buffer-overflow.patch
60
+ - ext/patches/zkc-3.4.5-config.patch
61
+ - ext/patches/zkc-3.4.5-fetch-and-add.patch
63
62
  - ext/patches/zkc-3.4.5-logging.patch
64
63
  - ext/patches/zkc-3.4.5-out-of-order-ping.patch
65
64
  - ext/patches/zkc-3.4.5-yosemite-htonl-fix.patch
@@ -118,25 +117,24 @@ files:
118
117
  homepage: https://github.com/slyphon/zookeeper
119
118
  licenses: []
120
119
  metadata: {}
121
- post_install_message:
120
+ post_install_message:
122
121
  rdoc_options: []
123
122
  require_paths:
124
123
  - lib
125
124
  - ext
126
125
  required_ruby_version: !ruby/object:Gem::Requirement
127
126
  requirements:
128
- - - ! '>='
127
+ - - ">="
129
128
  - !ruby/object:Gem::Version
130
129
  version: '0'
131
130
  required_rubygems_version: !ruby/object:Gem::Requirement
132
131
  requirements:
133
- - - ! '>='
132
+ - - ">="
134
133
  - !ruby/object:Gem::Version
135
134
  version: '0'
136
135
  requirements: []
137
- rubyforge_project:
138
- rubygems_version: 2.2.2
139
- signing_key:
136
+ rubygems_version: 3.2.3
137
+ signing_key:
140
138
  specification_version: 4
141
139
  summary: Apache ZooKeeper driver for Rubies
142
140
  test_files:
@@ -157,3 +155,4 @@ test_files:
157
155
  - spec/support/progress_formatter.rb
158
156
  - spec/support/zookeeper_spec_helpers.rb
159
157
  - spec/zookeeper_spec.rb
158
+ ...
data/.travis.yml DELETED
@@ -1,39 +0,0 @@
1
- ---
2
- notifications:
3
- email:
4
- - slyphon@gmail.com
5
- - eric@5stops.com
6
-
7
- # pull in releaseops submodule
8
- before_install:
9
- - git submodule update --init --recursive
10
-
11
- env:
12
- - SPAWN_ZOOKEEPER='true'
13
-
14
- language: ruby
15
-
16
- rvm:
17
- - 1.9.3
18
- - 1.9.2
19
- - 1.8.7
20
- - ree
21
- - jruby-18mode
22
- - jruby-19mode
23
- - rbx-18mode
24
- - rbx-19mode
25
- - 2.0.0
26
- - 2.1.0
27
- - 2.2.0
28
- matrix:
29
- allow_failures:
30
- - rvm: rbx-18mode
31
- - rvm: rbx-19mode
32
-
33
- bundler_args: --without development docs coverage
34
-
35
- # blacklist
36
- branches:
37
- except:
38
- # - 'dev/zookeeper-st'
39
-