waterdrop 2.6.2 → 2.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ed8c6f17cd730ab82df21e696e472c51dd51379acf757f735d43de98c00dead
4
- data.tar.gz: 10f8b0d7bd64c26ba9b76c9edb76cf59f871cf44adbde2198907856f7b761ea4
3
+ metadata.gz: f051a62baab08b5b23bb85a5b2264f3b33bebb77c0f3628ed90eda5eda8c22f2
4
+ data.tar.gz: 9a5f27b24bee02bb2efcaeec926a8568c540c420c77cf1c9a06a6d72fcf496b1
5
5
  SHA512:
6
- metadata.gz: a41f9a5e1ef30c69221615552f48bad03099697d27a1e405f90ab189f6c21a33dedc6382c864d4790a22d798c64023a1802597f8ce255214d077de0ebcd5028b
7
- data.tar.gz: b21a71b53e188fd58ce8800bc23548cc3bbc0a876fe4aa8d9c67107b0e90ddfd6484c4e534137b63e4bb45d5760460ae4b7df79233d6a2acc85ba00d45a55e2a
6
+ metadata.gz: 7fd5cd82e391ad95e9c48b4e6794ad6b4e0715b6f4a64e838c676064b96e22c2c0a0cea1f18e4131c5dc60ae33923b943d2828278404038f5f7a79b754cb6e37
7
+ data.tar.gz: 004d5f3fdbbe48733ba47f132e12dcf1bd3ab5e0705181825f8e93b207e12b955b97cf6c283dcb58049153dd3325dd3ea655130e60982d0300ec309460e0d583
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ### 2.6.3 (2023-06-28)
4
+ - [Change] Use `Concurrent::AtomicFixnum` to track operations in progress to prevent potential race conditions on JRuby and TruffleRuby (not yet supported but this is for future usage).
5
+ - [Change] Require `karafka-rdkafka` `>= 0.13.2`.
6
+ - [Change] Require 'karafka-core' `>= 2.1.1`
7
+
3
8
  ### 2.6.2 (2023-06-21)
4
9
  - [Refactor] Introduce a counter-based locking approach to make sure, that we close the producer safely but at the same time not to limit messages production with producing lock.
5
10
  - [Refactor] Make private methods private.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (2.6.2)
5
- karafka-core (>= 2.1.0, < 3.0.0)
4
+ waterdrop (2.6.3)
5
+ karafka-core (>= 2.1.1, < 3.0.0)
6
6
  zeitwerk (~> 2.3)
7
7
 
8
8
  GEM
@@ -22,10 +22,10 @@ GEM
22
22
  ffi (1.15.5)
23
23
  i18n (1.14.1)
24
24
  concurrent-ruby (~> 1.0)
25
- karafka-core (2.1.0)
25
+ karafka-core (2.1.1)
26
26
  concurrent-ruby (>= 1.1)
27
- karafka-rdkafka (>= 0.13.0, < 0.14.0)
28
- karafka-rdkafka (0.13.0)
27
+ karafka-rdkafka (>= 0.13.1, < 0.14.0)
28
+ karafka-rdkafka (0.13.2)
29
29
  ffi (~> 1.15)
30
30
  mini_portile2 (~> 2.6)
31
31
  rake (> 12)
@@ -34,7 +34,7 @@ module WaterDrop
34
34
  # @param block [Proc] configuration block
35
35
  # @return [Producer] producer instance
36
36
  def initialize(&block)
37
- @operations_in_progress = 0
37
+ @operations_in_progress = Concurrent::AtomicFixnum.new(0)
38
38
  @buffer_mutex = Mutex.new
39
39
  @connecting_mutex = Mutex.new
40
40
  @operating_mutex = Mutex.new
@@ -138,7 +138,7 @@ module WaterDrop
138
138
 
139
139
  # Wait until all the outgoing operations are done. Only when no one is using the
140
140
  # underlying client running operations we can close
141
- sleep(0.001) until @operations_in_progress.zero?
141
+ sleep(0.001) until @operations_in_progress.value.zero?
142
142
 
143
143
  # Flush has its own buffer mutex but even if it is blocked, flushing can still happen
144
144
  # as we close the client after the flushing (even if blocked by the mutex)
@@ -205,9 +205,9 @@ module WaterDrop
205
205
  # This can happen only during flushing on closing, in case like this we don't have to
206
206
  # synchronize because we already own the lock
207
207
  if @operating_mutex.owned?
208
- @operations_in_progress += 1
208
+ @operations_in_progress.increment
209
209
  else
210
- @operating_mutex.synchronize { @operations_in_progress += 1 }
210
+ @operating_mutex.synchronize { @operations_in_progress.increment }
211
211
  ensure_active!
212
212
  end
213
213
 
@@ -248,10 +248,10 @@ module WaterDrop
248
248
  sleep @config.wait_backoff_on_queue_full
249
249
  end
250
250
 
251
- @operations_in_progress -= 1
251
+ @operations_in_progress.decrement
252
252
  retry
253
253
  ensure
254
- @operations_in_progress -= 1
254
+ @operations_in_progress.decrement
255
255
  end
256
256
  end
257
257
  end
@@ -3,5 +3,5 @@
3
3
  # WaterDrop library
4
4
  module WaterDrop
5
5
  # Current WaterDrop version
6
- VERSION = '2.6.2'
6
+ VERSION = '2.6.3'
7
7
  end
data/lib/waterdrop.rb CHANGED
@@ -9,6 +9,7 @@
9
9
  securerandom
10
10
  karafka-core
11
11
  pathname
12
+ concurrent/atomic/atomic_fixnum
12
13
  ].each { |lib| require lib }
13
14
 
14
15
  # WaterDrop library
data/waterdrop.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.description = spec.summary
17
17
  spec.license = 'MIT'
18
18
 
19
- spec.add_dependency 'karafka-core', '>= 2.1.0', '< 3.0.0'
19
+ spec.add_dependency 'karafka-core', '>= 2.1.1', '< 3.0.0'
20
20
  spec.add_dependency 'zeitwerk', '~> 2.3'
21
21
 
22
22
  if $PROGRAM_NAME.end_with?('gem')
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waterdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2023-06-21 00:00:00.000000000 Z
38
+ date: 2023-06-28 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka-core
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.1.0
46
+ version: 2.1.1
47
47
  - - "<"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 3.0.0
@@ -53,7 +53,7 @@ dependencies:
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 2.1.0
56
+ version: 2.1.1
57
57
  - - "<"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 3.0.0
metadata.gz.sig CHANGED
Binary file