racecar 2.8.0.beta.1 → 2.8.1

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: ff2401948ddb05893940406eca4f44df6e7944f7788bed25caee285473141ec5
4
- data.tar.gz: e4e72978b765c52bb245050c74c4c40c4454875d34bb858f9bf7f0bb55a9a8a6
3
+ metadata.gz: 57cb3620129ee81064462c9eaaa5a62aa1e853ce833a3c5caaf92581a37f0589
4
+ data.tar.gz: f3be03832ce0451a371139bcb866add561ed428d5a10ac026de6e360cdebd73a
5
5
  SHA512:
6
- metadata.gz: a3fbda8f0041a37760f3c756cf0cd86ade5c60bb7eaabeb65902be9c0daf7e705de3b60c2c2d8f0ed6732127f93a40af0f77a5174243b4897ce4166790c02f40
7
- data.tar.gz: 01ed74f543f8c92abfef5bc0d3a626d2b7e03bc708814dfa1998846855609adc663594a30101679cb790db5050aea45b9e3111863fbff746a73d959f02fe85af
6
+ metadata.gz: c0d9c85c05f4b54ff56fd6ae93e009ea7369f432b744c999539750028d93a4249394757cc3ca881f756e6aec7dd2eef915f4af50bfd12ff639856f7f8196aeca
7
+ data.tar.gz: 9eaf0c6037606aa964cd1ea1a549bf44dfeba006133bbd7ef64778e7725da804d95bece47b866fb14c0941eab6fb7821c41055f938e14a44112c4e4c6c05b0ae
data/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Unreleased
4
4
 
5
5
  ## v2.8.0
6
- * Update librdkafka version from 1.8.2 to 1.9.0 by upgrading from rdkafka 0.10.0 to 0.12.0. ([#283](https://github.com/zendesk/racecar/pull/286))
6
+ * Update librdkafka version from 1.8.2 to 1.9.0 by upgrading from rdkafka 0.10.0 to 0.12.0. ([#283](https://github.com/zendesk/racecar/pull/293))
7
7
 
8
8
  ## v2.7.0
9
9
 
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- racecar (2.8.0.beta.1)
4
+ racecar (2.8.1)
5
5
  king_konf (~> 1.0.0)
6
- rdkafka (~> 0.12.0.beta.1)
6
+ rdkafka (~> 0.12.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -28,7 +28,7 @@ GEM
28
28
  coderay (~> 1.1)
29
29
  method_source (~> 1.0)
30
30
  rake (13.0.1)
31
- rdkafka (0.12.0.beta.1)
31
+ rdkafka (0.12.0)
32
32
  ffi (~> 1.15)
33
33
  mini_portile2 (~> 2.6)
34
34
  rake (> 12)
@@ -49,6 +49,9 @@ module Racecar
49
49
 
50
50
  def store_offset(message)
51
51
  current.store_offset(message)
52
+ rescue Rdkafka::RdkafkaError => e
53
+ raise ErroneousStateError.new(e) if e.code == :state # -172
54
+ raise e
52
55
  end
53
56
 
54
57
  def commit
@@ -0,0 +1,34 @@
1
+ # `rd_kafka_offsets_store()` (et.al) returns an error for any
2
+ # partition that is not currently assigned (through `rd_kafka_*assign()`).
3
+ # This prevents a race condition where an application would store offsets
4
+ # after the assigned partitions had been revoked (which resets the stored
5
+ # offset), that could cause these old stored offsets to be committed later
6
+ # when the same partitions were assigned to this consumer again - effectively
7
+ # overwriting any committed offsets by any consumers that were assigned the
8
+ # same partitions previously. This would typically result in the offsets
9
+ # rewinding and messages to be reprocessed.
10
+ # As an extra effort to avoid this situation the stored offset is now
11
+ # also reset when partitions are assigned (through `rd_kafka_*assign()`).
12
+ module Racecar
13
+ class ErroneousStateError < StandardError
14
+ def initialize(rdkafka_error)
15
+ raise rdkafka_error unless rdkafka_error.is_a?(Rdkafka::RdkafkaError)
16
+
17
+ @rdkafka_error = rdkafka_error
18
+ end
19
+
20
+ attr_reader :rdkafka_error
21
+
22
+ def code
23
+ @rdkafka_error.code
24
+ end
25
+
26
+ def to_s
27
+ <<~EOM
28
+ Partition is no longer assigned to this consumer and the offset could not be stored for commit:
29
+ #{@rdkafka_error.to_s}
30
+ EOM
31
+ end
32
+
33
+ end
34
+ end
@@ -4,6 +4,7 @@ require "rdkafka"
4
4
  require "racecar/pause"
5
5
  require "racecar/message"
6
6
  require "racecar/message_delivery_error"
7
+ require "racecar/erroneous_state_error"
7
8
 
8
9
  module Racecar
9
10
  class Runner
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Racecar
4
- VERSION = "2.8.0.beta.1"
4
+ VERSION = "2.8.1"
5
5
  end
data/racecar.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.required_ruby_version = '>= 2.6'
24
24
 
25
25
  spec.add_runtime_dependency "king_konf", "~> 1.0.0"
26
- spec.add_runtime_dependency "rdkafka", "~> 0.12.0.beta.1"
26
+ spec.add_runtime_dependency "rdkafka", "~> 0.12.0"
27
27
 
28
28
  spec.add_development_dependency "bundler", [">= 1.13", "< 3"]
29
29
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racecar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0.beta.1
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-03-24 00:00:00.000000000 Z
12
+ date: 2022-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: king_konf
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.12.0.beta.1
34
+ version: 0.12.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.12.0.beta.1
41
+ version: 0.12.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bundler
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -200,6 +200,7 @@ files:
200
200
  - lib/racecar/ctl.rb
201
201
  - lib/racecar/daemon.rb
202
202
  - lib/racecar/datadog.rb
203
+ - lib/racecar/erroneous_state_error.rb
203
204
  - lib/racecar/heroku.rb
204
205
  - lib/racecar/instrumenter.rb
205
206
  - lib/racecar/message.rb
@@ -226,9 +227,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
227
  version: '2.6'
227
228
  required_rubygems_version: !ruby/object:Gem::Requirement
228
229
  requirements:
229
- - - ">"
230
+ - - ">="
230
231
  - !ruby/object:Gem::Version
231
- version: 1.3.1
232
+ version: '0'
232
233
  requirements: []
233
234
  rubygems_version: 3.0.3
234
235
  signing_key: