work_shaper 0.1.2.7rc2 → 0.1.2.7
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 +9 -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: 10f494bd3f41faa9fb21c35b15fa84f70fca9f7aa4d2edf011c380251366e757
|
4
|
+
data.tar.gz: 3986b290a21e7c96a812edfc82e1785af73de082711e816158f19b85fdeb0105
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07de555d74c0274b4cd00556698d51bd5eb8c79c42d69481862a673487f45ca2f340e7c8fa70e9aab65b8d38df1feb71cfeb07eb4af127a06814b7965fbd092b
|
7
|
+
data.tar.gz: 7a80244bfe0dfc546029bfe69f7c2ea88b35e41cfb0e8f39e05216d03d3e7ffd3416261894c2a8ba791ec1dbb913634fbfa56368a20cf2d0cd3c6b9ae4c8616a
|
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
|
39
39
|
sleep heartbeat_period_sec
|
40
40
|
end
|
41
41
|
rescue => e
|
@@ -134,20 +134,19 @@ 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]
|
138
|
+
received = @received_offsets[partition]
|
139
139
|
|
140
|
-
offset = completed.first
|
141
|
-
while received.any? && received.first == offset
|
140
|
+
offset = completed.sort.first
|
141
|
+
while received.any? && received.sort.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.
|
145
145
|
last_offset = @last_ack[partition]
|
146
146
|
if last_offset && offset <= last_offset
|
147
147
|
WorkShaper.logger.warn(
|
148
|
-
{ message: 'Received
|
149
|
-
offset: "#{partition}:#{offset}"
|
150
|
-
last_acked: last_offset,
|
148
|
+
{ message: 'Received Dupilcate Offset',
|
149
|
+
offset: "#{partition}:#{offset}"
|
151
150
|
})
|
152
151
|
else
|
153
152
|
result = @ack.call(partition, offset)
|
@@ -158,9 +157,10 @@ module WorkShaper
|
|
158
157
|
completed: @completed_offsets[partition].to_a[0..10].join(','),
|
159
158
|
received: @received_offsets[partition].to_a[0..10].join(',')
|
160
159
|
})
|
160
|
+
else
|
161
|
+
@last_ack[partition] = offset
|
161
162
|
end
|
162
163
|
end
|
163
|
-
@last_ack[partition] = offset
|
164
164
|
|
165
165
|
@total_acked += 1
|
166
166
|
WorkShaper.logger.debug "@total_acked: #{@total_acked}"
|
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.7
|
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: '0'
|
68
68
|
requirements: []
|
69
69
|
rubygems_version: 3.4.10
|
70
70
|
signing_key:
|