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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +5 -5
- data/lib/waterdrop/producer.rb +6 -6
- data/lib/waterdrop/version.rb +1 -1
- data/lib/waterdrop.rb +1 -0
- data/waterdrop.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f051a62baab08b5b23bb85a5b2264f3b33bebb77c0f3628ed90eda5eda8c22f2
|
4
|
+
data.tar.gz: 9a5f27b24bee02bb2efcaeec926a8568c540c420c77cf1c9a06a6d72fcf496b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
5
|
-
karafka-core (>= 2.1.
|
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.
|
25
|
+
karafka-core (2.1.1)
|
26
26
|
concurrent-ruby (>= 1.1)
|
27
|
-
karafka-rdkafka (>= 0.13.
|
28
|
-
karafka-rdkafka (0.13.
|
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)
|
data/lib/waterdrop/producer.rb
CHANGED
@@ -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
|
208
|
+
@operations_in_progress.increment
|
209
209
|
else
|
210
|
-
@operating_mutex.synchronize { @operations_in_progress
|
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
|
251
|
+
@operations_in_progress.decrement
|
252
252
|
retry
|
253
253
|
ensure
|
254
|
-
@operations_in_progress
|
254
|
+
@operations_in_progress.decrement
|
255
255
|
end
|
256
256
|
end
|
257
257
|
end
|
data/lib/waterdrop/version.rb
CHANGED
data/lib/waterdrop.rb
CHANGED
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.
|
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.
|
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-
|
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.
|
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.
|
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
|