work_shaper 0.1.2.5 → 0.1.2.7rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/work_shaper/manager.rb +5 -9
- data/lib/work_shaper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a61dd1fcd9a569a13dc199d0ecdbbce5dc1abe66898b045fc1b742a8f45a9c2
|
4
|
+
data.tar.gz: b34b221927a2ff62018b7a79a93dfc8d3ee1ad9f25fd0ba70bf668257921c05b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6817bcc2e13e8af7d0090a1e1c1a2aeb2d3be7ed724a91d9312a2d20af6864fd94ec9d74583ccfce6cbc4f08a4a03e52ca552c685c51e05a9636e09f806b00d
|
7
|
+
data.tar.gz: 03f97b63d429492b7f60337ae70583e6d593f13068b01cee9be5dd04e4e19da78e912fcfb870c6bfbedc08319748c85a7b963b2d7567f2e4ae0fb38ca531ccd1
|
data/lib/work_shaper/manager.rb
CHANGED
@@ -35,7 +35,7 @@ module WorkShaper
|
|
35
35
|
|
36
36
|
@heartbeat = Thread.new do
|
37
37
|
while true
|
38
|
-
report
|
38
|
+
report(detailed: false)
|
39
39
|
sleep heartbeat_period_sec
|
40
40
|
end
|
41
41
|
rescue => e
|
@@ -134,11 +134,11 @@ module WorkShaper
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def offset_ack_unsafe(partition)
|
137
|
-
completed = @completed_offsets[partition]
|
138
|
-
received = @received_offsets[partition]
|
137
|
+
completed = @completed_offsets[partition].sort
|
138
|
+
received = @received_offsets[partition].sort
|
139
139
|
|
140
|
-
offset = completed.
|
141
|
-
while received.any? && received.
|
140
|
+
offset = completed.first
|
141
|
+
while received.any? && received.first == offset
|
142
142
|
# We observed Kafka sending the same message twice, even after
|
143
143
|
# having committed the offset. Here we skip this offset if we
|
144
144
|
# know it has already been committed.
|
@@ -175,11 +175,7 @@ module WorkShaper
|
|
175
175
|
|
176
176
|
def pause_on_overrun
|
177
177
|
overrun = lambda do
|
178
|
-
completed = @completed_offsets.values.flatten.count
|
179
|
-
received = @received_offsets.values.flatten.count
|
180
|
-
|
181
178
|
@total_enqueued.to_i - @total_acked.to_i > @max_in_queue
|
182
|
-
received - completed > @max_in_queue
|
183
179
|
end
|
184
180
|
|
185
181
|
# We have to be careful here to avoid a deadlock. Another thread may be waiting
|
data/lib/work_shaper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: work_shaper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.
|
4
|
+
version: 0.1.2.7rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerry Fernholz
|
@@ -62,9 +62,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
62
|
version: 2.6.0
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 1.3.1
|
68
68
|
requirements: []
|
69
69
|
rubygems_version: 3.4.10
|
70
70
|
signing_key:
|