zookeeper-ng 1.5 → 1.5.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +57 -0
- data/.gitmodules +1 -1
- data/CHANGELOG +15 -2
- data/README.markdown +5 -28
- data/Rakefile +5 -5
- data/ext/c_zookeeper.rb +16 -16
- data/ext/patches/{zkc-3.4.5-overflow.patch → zkc-3.4.5-buffer-overflow.patch} +4 -4
- data/ext/patches/zkc-3.4.5-config.patch +5454 -0
- data/ext/zkrb.c +7 -2
- data/java/java_base.rb +2 -4
- data/lib/zookeeper/version.rb +1 -1
- data/spec/forked_connection_spec.rb +3 -5
- data/spec/shared/connection_examples.rb +5 -1
- data/spec/support/10_spawn_zookeeper.rb +0 -4
- data/zookeeper.gemspec +11 -3
- metadata +9 -8
- data/.travis.yml +0 -25
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,
|
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))
|
data/lib/zookeeper/version.rb
CHANGED
@@ -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
|
-
|
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
|
data/zookeeper.gemspec
CHANGED
@@ -6,13 +6,21 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'zookeeper-ng'
|
7
7
|
s.version = Zookeeper::VERSION
|
8
8
|
|
9
|
-
s.authors = [
|
10
|
-
|
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
|
+
]
|
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: {
|
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,30 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zookeeper-ng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.5.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Ben Fritsch
|
8
7
|
- Phillip Pearson
|
9
8
|
- Eric Maland
|
10
9
|
- Evan Weaver
|
11
10
|
- Brian Wickman
|
12
11
|
- Neil Conway
|
13
12
|
- Jonathan D. Simms
|
13
|
+
- Mal McKay
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
18
18
|
dependencies: []
|
19
19
|
description: |+
|
20
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
|
-
MRI: {
|
22
|
+
MRI: {2.5, 2.6, 2.7, 3.0}, JRuby: ~> 9.2.x.x
|
23
23
|
|
24
24
|
This library uses version 3.4.5 of zookeeper bindings.
|
25
25
|
|
26
26
|
email:
|
27
|
-
-
|
27
|
+
- slyphon@gmail.com
|
28
28
|
executables: []
|
29
29
|
extensions:
|
30
30
|
- ext/extconf.rb
|
@@ -34,9 +34,9 @@ files:
|
|
34
34
|
- ".dotfiles/ruby-gemset"
|
35
35
|
- ".dotfiles/ruby-version"
|
36
36
|
- ".dotfiles/rvmrc"
|
37
|
+
- ".github/workflows/build.yml"
|
37
38
|
- ".gitignore"
|
38
39
|
- ".gitmodules"
|
39
|
-
- ".travis.yml"
|
40
40
|
- CHANGELOG
|
41
41
|
- Gemfile
|
42
42
|
- Guardfile
|
@@ -56,10 +56,11 @@ files:
|
|
56
56
|
- ext/extconf.rb
|
57
57
|
- ext/generate_gvl_code.rb
|
58
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
|
59
61
|
- ext/patches/zkc-3.4.5-fetch-and-add.patch
|
60
62
|
- ext/patches/zkc-3.4.5-logging.patch
|
61
63
|
- ext/patches/zkc-3.4.5-out-of-order-ping.patch
|
62
|
-
- ext/patches/zkc-3.4.5-overflow.patch
|
63
64
|
- ext/patches/zkc-3.4.5-yosemite-htonl-fix.patch
|
64
65
|
- ext/zkc-3.4.5.tar.gz
|
65
66
|
- ext/zkrb.c
|
@@ -132,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
133
|
- !ruby/object:Gem::Version
|
133
134
|
version: '0'
|
134
135
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
136
|
+
rubygems_version: 3.3.3
|
136
137
|
signing_key:
|
137
138
|
specification_version: 4
|
138
139
|
summary: Apache ZooKeeper driver for Rubies
|
data/.travis.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
---
|
2
|
-
notifications:
|
3
|
-
email:
|
4
|
-
- ich@abwesend.com
|
5
|
-
|
6
|
-
# pull in releaseops submodule
|
7
|
-
before_install:
|
8
|
-
- git submodule update --init --recursive
|
9
|
-
|
10
|
-
env:
|
11
|
-
- SPAWN_ZOOKEEPER='true'
|
12
|
-
|
13
|
-
language: ruby
|
14
|
-
|
15
|
-
rvm:
|
16
|
-
- 2.6
|
17
|
-
- 2.7
|
18
|
-
- 3.0
|
19
|
-
|
20
|
-
bundler_args: --without development docs coverage
|
21
|
-
|
22
|
-
# blacklist
|
23
|
-
branches:
|
24
|
-
except:
|
25
|
-
# - 'dev/zookeeper-st'
|