zookeeper 1.4.11-java → 1.5.3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZDViMzg5YTZiNzUzM2IwMTJlZDI2YTA4ZWUwODBiNDdkNTIxZDUxNg==
5
- data.tar.gz: !binary |-
6
- MzJjNjQyNTZjZmNkMDgyZTdmOTJjMDhhOWQ2ZjY3ZWVlYWQ1NzgzYg==
2
+ SHA256:
3
+ metadata.gz: f8285e314ad0ccf4d29ba76c0057886ba4c0adb271667feda8896948b84ebb96
4
+ data.tar.gz: 0bcc72fbd77feef7cd92100abcef9af615ecfd315a98075d163243f3071eb26f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MzU5YzkzYzk1MDNlMTAyOTZjODc4ZTdkODA3MWNlZTU2MjZlYTRlOTUxZWMz
10
- MjFjNjM2NTY0OGY1NjA1YzQ5MzY3NmZkZWQxMzM3MWFmZWFiNjRlNTZlYzFi
11
- OTcwMDA1NjA2MzI3M2RmMDE5NDA3MGVkY2IzZjdhZDIwZjBhMGI=
12
- data.tar.gz: !binary |-
13
- YWIxMGQ0ZWU3NTk5NDE5Y2QyYmRlMTE4NmUzYmZiZThkM2ZmZmM3OWM3ZjQx
14
- MTUwMjg0ODgyMWQyNjAzYzk0YmFiNWU0NGIyZGEwZjYyNGEwYTllZjVjMTk3
15
- ZWFiMTRkZGVhMzQ5NDViNjNkYTM2YTY2ZjJkYjdmYzE0MjIxODE=
6
+ metadata.gz: 45230151b25a8025676938423326ee3e6bc6d220e8fcdf369afd1aeb69c1b464dce2b4001b117b23f62ddadd1c83b20677121bae71d29aacbd5a8e3867136bef
7
+ data.tar.gz: 43982207320acd3621269347571ddb189560be5c47f7e029bb92499121358d5cf842cfd1ffb8a0a03bb3dcd14f8e0e1eb21020ad10b9d727f07af81c7b041088
@@ -0,0 +1,57 @@
1
+ on:
2
+ pull_request:
3
+ branches:
4
+ - master
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ jobs:
10
+ build:
11
+ name: Ruby ${{ matrix.ruby }} / GCC ${{ matrix.gcc }} / ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os:
17
+ - ubuntu-latest
18
+ - macos-latest
19
+ ruby:
20
+ - '2.5'
21
+ - '2.6'
22
+ - '2.7'
23
+ - '3.0'
24
+ - '3.1'
25
+ - 'jruby'
26
+ gcc:
27
+ - 7
28
+ - latest
29
+ exclude:
30
+ - os: macos-latest
31
+ gcc: 7
32
+
33
+ steps:
34
+ - uses: actions/checkout@v2
35
+ with:
36
+ submodules: recursive
37
+
38
+ - name: Set up GCC
39
+ if: ${{ matrix.gcc != 'latest' }}
40
+ uses: egor-tensin/setup-gcc@v1
41
+ with:
42
+ version: ${{ matrix.gcc }}
43
+ platform: x64
44
+
45
+ - name: Set up Ruby
46
+ uses: ruby/setup-ruby@v1
47
+ with:
48
+ ruby-version: ${{ matrix.ruby }}
49
+ bundler-cache: true
50
+ cache-version: 1_${{ matrix.ruby }}_${{ matrix.os }}
51
+
52
+ - name: Run Tests
53
+ env:
54
+ RAILS_ENV: test
55
+ SPAWN_ZOOKEEPER: true
56
+ run: |
57
+ bundle exec rake
data/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
1
  [submodule "releaseops"]
2
2
  path = releaseops
3
- url = git://github.com/slyphon/releaseops.git
3
+ url = https://github.com/zk-ruby/releaseops.git
data/CHANGELOG CHANGED
@@ -1,3 +1,23 @@
1
+ v1.5.3
2
+ * Ruby 3.1 compatibility (h/t: @casperisfine)
3
+
4
+ v1.5.2 (YANKED)
5
+ * Ruby 3.1 compatibility and zookeeper client updates.
6
+ * This release had build issues in the wild and was yanked
7
+
8
+ v1.5.1
9
+ * Update config.guess to support newer environments (h/t: @malmckay)
10
+
11
+ v1.5.0
12
+ * (housekeeping) Moves build to Github Actions from TravisCI
13
+ * (housekeeping) Drops build support for MRI Ruby < 2.5 and other rubies
14
+ * Build on Ruby 3 (#99) (h/t: @malmckay)
15
+ * Build on MacOS (#98) (h/t: @malmckay)
16
+ * Work around compiler errors on newer versions of gcc (#97) (h/t: @nickmarden)
17
+ * Fix a typo on a has_key (#83) (h/t: @lexspoon)
18
+ * Adds support macOS dylib (#86) (h/t: @pftg)
19
+ * Fix compilation on ARM (#82) (h/t: @cdonati)
20
+
1
21
  v1.4.11
2
22
  * backported fix for ZOOKEEPER-2253 by @chchen - #76
3
23
 
data/README.markdown CHANGED
@@ -1,6 +1,7 @@
1
1
  # zookeeper #
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/zk-ruby/zookeeper.png?branch=master)](http://travis-ci.org/zk-ruby/zookeeper)
3
+ ![Build Status](https://github.com/zk-ruby/zookeeper/actions/workflows/build.yml/badge.svg)
4
+
4
5
 
5
6
  An interface to the Zookeeper cluster coordination server.
6
7
 
@@ -10,14 +11,10 @@ For a higher-level interface with a more convenient API and features such as loc
10
11
 
11
12
  As of 1.1.0, this library is fork-safe (which was not easy to accomplish). This means you can use it without worry in unicorn, resque, and whatever other fork-philic frameworks you sick little monkeys are using this week. The only rule is that after a fork(), you need to call `#reopen` on the client ASAP, because if you try to peform any other action, an exception will be raised. Other than that, there is no special action that is needed in the parent.
12
13
 
13
- ## Big Plans for 1.0 ##
14
-
15
- The 1.0 release will feature a reorganization of the heirarchy. There will be a single top-level `Zookeeper` namespace (as opposed to the current layout, with 5-6 different top-level constants), and for the next several releases, there will be a backwards compatible require for users that still need to use the old names.
16
-
17
14
  ## License
18
15
 
19
- Copyright 2008 Phillip Pearson, and 2010 Twitter, Inc.
20
- Licensed under the MIT License. See the included LICENSE file.
16
+ Copyright 2008 Phillip Pearson, and 2010 Twitter, Inc.
17
+ Licensed under the MIT License. See the included LICENSE file.
21
18
 
22
19
  Portions copyright 2008-2010 the Apache Software Foundation, licensed under the
23
20
  Apache 2 license, and used with permission.
@@ -28,26 +25,6 @@ Portions contributed to the open source community by HPDC, L.P.
28
25
 
29
26
  sudo gem install zookeeper
30
27
 
31
- ### rbenv is awesome
32
-
33
- UPDATE: this appears to have been fixed by @eric in [this patch](http://git.io/PEPgnA). If you use rbenv, please report any issues, but I believe it should work now.
34
-
35
- Let me start out by saying I prefer rvm, and that I really don't know a whole lot about linking on OS X. Or Linux. Any suggestions or constructive insults would be greatly appreciated if you have insight into what i'm doing wrong here.
36
-
37
- So, it seems that [ruby-build][] doesn't use `--enable-shared` by default. I'm told this is for speed.
38
-
39
- If you run into problems with installing this gem (specifically with linking ex. `Undefined symbols for architecture x86_64`) and you're using rbenv, for now you need to ensure that your ruby was built with `--enable-shared`. I'm sorry for the inconvenience. (no, really)
40
-
41
- ```shell
42
- ~ $ CONFIGURE_OPTS='--enable-shared --disable-install-doc' rbenv install 1.9.3-p194
43
- ```
44
-
45
- [ruby-build]: https://github.com/sstephenson/ruby-build
46
-
47
- ### A note for REE users
48
-
49
- The zookeeper client is required to send a heartbeat packet every N seconds to the server. If it misses its deadline 3 times in a row, the session will be lost. The way the client is implemented in versions `>= 1.2`, a *ruby* thread acts as the event thread (this was necessary to provide a fork-safe client with a parent process that is able to preserve state). Some users have reported issues where under load in "massive codebases," they have problems where calls will time out. Given the nature of the thread scheduler in 1.8, one should be careful if upgrading from `0.4.4` to `>= 1.2`.
50
-
51
28
  ## Usage
52
29
 
53
30
  Connect to a server:
@@ -75,7 +52,7 @@ Calls take a dictionary of parameters. With the exception of set\_acl, the only
75
52
 
76
53
  ### A Bit about this repository ###
77
54
 
78
- Twitter's open source office was kind enough to transfer this repository to facilitate development and administration of this repository. The `zookeeper` gem's last three releases were recorded in branches `v0.4.2`, `v0.4.3` and `v0.4.4`. Releases of the `slyphon-zookeeper` gem were cut off of the fork, and unfortunately (due to an oversight on my part) were tagged with unrelated versions. Those were tagged with names `release/0.9.2`.
55
+ Twitter's open source office was kind enough to transfer this repository to facilitate development and administration of this repository. The `zookeeper` gem's last three releases were recorded in branches `v0.4.2`, `v0.4.3` and `v0.4.4`. Releases of the `slyphon-zookeeper` gem were cut off of the fork, and unfortunately (due to an oversight on my part) were tagged with unrelated versions. Those were tagged with names `release/0.9.2`.
79
56
 
80
57
  The plan is to keep the `slyphon-zookeeper` tags, and to tag the `zookeeper` releases `twitter/release/0.4.x`.
81
58
 
data/Rakefile CHANGED
@@ -38,7 +38,7 @@ if File.exists?(release_ops_path)
38
38
 
39
39
  orig_dir = Dir.getwd
40
40
 
41
- cd tmpdir do
41
+ Dir.chdir tmpdir do
42
42
  sh "git co #{tag} && git reset --hard && git clean -fdx"
43
43
 
44
44
  ENV['JAVA_GEM'] = nil
@@ -77,7 +77,7 @@ end
77
77
  VALGRIND_BASIC_OPTS = '--num-callers=50 --error-limit=no --partial-loads-ok=yes --undef-value-errors=no --trace-children=yes'
78
78
 
79
79
  task 'valgrind' do
80
- cd 'ext' do
80
+ Dir.chdir 'ext' do
81
81
  sh "rake clean build"
82
82
  end
83
83
 
@@ -86,7 +86,7 @@ end
86
86
 
87
87
  namespace :build do
88
88
  task :clean do
89
- cd 'ext' do
89
+ Dir.chdir 'ext' do
90
90
  sh 'rake clean'
91
91
  end
92
92
 
@@ -94,7 +94,7 @@ namespace :build do
94
94
  end
95
95
 
96
96
  task :clobber do
97
- cd 'ext' do
97
+ Dir.chdir 'ext' do
98
98
  sh 'rake clobber'
99
99
  end
100
100
 
@@ -104,7 +104,7 @@ end
104
104
 
105
105
  desc "Build C component"
106
106
  task :build do
107
- cd 'ext' do
107
+ Dir.chdir 'ext' do
108
108
  sh "rake"
109
109
  end
110
110
  end
data/ext/c_zookeeper.rb CHANGED
@@ -48,7 +48,7 @@ class CZookeeper
48
48
 
49
49
  # keep track of the pid that created us
50
50
  update_pid!
51
-
51
+
52
52
  # used by the C layer. CZookeeper sets this to true when the init method
53
53
  # has completed. once this is set to true, it stays true.
54
54
  #
@@ -68,7 +68,7 @@ class CZookeeper
68
68
  @_receive_timeout_msec = opts[:receive_timeout_msec] || DEFAULT_RECEIVE_TIMEOUT_MSEC
69
69
 
70
70
  @mutex = Monitor.new
71
-
71
+
72
72
  # used to signal that we're running
73
73
  @running_cond = @mutex.new_cond
74
74
 
@@ -80,7 +80,7 @@ class CZookeeper
80
80
  @state = ZOO_CLOSED_STATE
81
81
 
82
82
  @pipe_read, @pipe_write = IO.pipe
83
-
83
+
84
84
  @event_thread = nil
85
85
 
86
86
  # hash of in-flight Continuation instances
@@ -142,7 +142,7 @@ class CZookeeper
142
142
 
143
143
  nil
144
144
  end
145
-
145
+
146
146
  # call this to stop the event loop, you can resume with the
147
147
  # resume method
148
148
  #
@@ -157,7 +157,7 @@ class CZookeeper
157
157
  def resume_after_fork_in_parent
158
158
  logger.debug { "##{__method__}" }
159
159
 
160
- @mutex.synchronize do
160
+ @mutex.synchronize do
161
161
  @_shutting_down = nil
162
162
  start_event_thread
163
163
  end
@@ -181,7 +181,7 @@ class CZookeeper
181
181
  return false unless wait_until_running(timeout)
182
182
 
183
183
  @state_mutex.synchronize do
184
- while true
184
+ while true
185
185
  if timeout
186
186
  now = Time.now
187
187
  break if (@state == ZOO_CONNECTED_STATE) || unhealthy? || (now > time_to_stop)
@@ -212,7 +212,7 @@ class CZookeeper
212
212
  !unhealthy?
213
213
  end
214
214
 
215
- # submits a job for processing
215
+ # submits a job for processing
216
216
  # blocks the caller until result has returned
217
217
  def submit_and_block(meth, *args)
218
218
  @mutex.synchronize do
@@ -230,9 +230,9 @@ class CZookeeper
230
230
  wake_event_loop!
231
231
  cnt.value
232
232
  end
233
-
233
+
234
234
  # this method is part of the reopen/close code, and is responsible for
235
- # shutting down the dispatch thread.
235
+ # shutting down the dispatch thread.
236
236
  #
237
237
  # this method must be EXTERNALLY SYNCHRONIZED!
238
238
  #
@@ -243,7 +243,7 @@ class CZookeeper
243
243
  logger.debug { "##{__method__}" }
244
244
  shut_down!
245
245
  wake_event_loop!
246
- @event_thread.join
246
+ @event_thread.join
247
247
  @event_thread = nil
248
248
  end
249
249
  end
@@ -259,7 +259,7 @@ class CZookeeper
259
259
  # or until timeout seconds have passed.
260
260
  #
261
261
  # returns true if we're running, false if we timed out
262
- def wait_until_running(timeout=5)
262
+ def wait_until_running(timeout=5)
263
263
  @mutex.synchronize do
264
264
  return true if @_running
265
265
  @running_cond.wait(timeout)
@@ -279,7 +279,7 @@ class CZookeeper
279
279
  submit_pending_calls
280
280
  end
281
281
 
282
- zkrb_iterate_event_loop
282
+ zkrb_iterate_event_loop
283
283
  iterate_event_delivery
284
284
  end
285
285
 
@@ -328,7 +328,7 @@ class CZookeeper
328
328
  end
329
329
 
330
330
  def wake_event_loop!
331
- @pipe_write && @pipe_write.write('1')
331
+ @pipe_write && !@pipe_write.closed? && @pipe_write.write('1')
332
332
  end
333
333
 
334
334
  def iterate_event_delivery
@@ -345,10 +345,10 @@ class CZookeeper
345
345
  end
346
346
  end
347
347
  end
348
-
348
+
349
349
  cntn = @reg.in_flight.delete(hash[:req_id])
350
350
 
351
- if cntn and not cntn.user_callback? # this is one of "our" continuations
351
+ if cntn and not cntn.user_callback? # this is one of "our" continuations
352
352
  cntn.call(hash) # so we handle delivering it
353
353
  next # and skip handing it to the dispatcher
354
354
  end
@@ -374,7 +374,7 @@ class CZookeeper
374
374
  def shut_down!
375
375
  logger.debug { "##{__method__}" }
376
376
 
377
- @mutex.synchronize do
377
+ @mutex.synchronize do
378
378
  @_shutting_down = true
379
379
  # ollie ollie oxen all home free!
380
380
  @running_cond.broadcast
data/ext/extconf.rb CHANGED
@@ -84,8 +84,10 @@ end
84
84
  # Absolutely prevent the linker from picking up any other zookeeper_mt
85
85
  Dir.chdir("#{HERE}/lib") do
86
86
  %w[st mt].each do |stmt|
87
- %w[a la].each do |ext|
88
- system("cp -f libzookeeper_#{stmt}.#{ext} libzookeeper_#{stmt}_gem.#{ext}")
87
+ %w[a la dylib].each do |ext|
88
+ origin_lib_name = "libzookeeper_#{stmt}.#{ext}"
89
+ dest_lib_name = "libzookeeper_#{stmt}_gem.#{ext}"
90
+ system("cp -f #{origin_lib_name} #{dest_lib_name}") if File.exists?(origin_lib_name)
89
91
  end
90
92
  end
91
93
  end
@@ -0,0 +1,11 @@
1
+ --- zkc-3.4.5.orig/c/src/zookeeper.c 2020-08-13 03:04:49.631654715 -0400
2
+ +++ zkc-3.4.5/c/src/zookeeper.c 2020-08-13 03:03:24.983922697 -0400
3
+ @@ -3411,7 +3411,7 @@
4
+
5
+ static const char* format_endpoint_info(const struct sockaddr_storage* ep)
6
+ {
7
+ - static char buf[128];
8
+ + static char buf[128+6];
9
+ char addrstr[128];
10
+ void *inaddr;
11
+ #ifdef WIN32