karafka 2.0.4 → 2.0.5

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: 8f065ff811caf7ed4cf8c1b39c09c5936bc06ef99f51ee8040ed00164dcffbe6
4
- data.tar.gz: 878c4a53feaaa8587334cfb7c6c19d370ffaf03b6d67ef6ddeb50699da4d7322
3
+ metadata.gz: 33b667b0c2ffe038b4c352e35502c35ab367cf9912b0b266d7613c4e12f01ff6
4
+ data.tar.gz: 1d4c77dc43e9d756c1c3ee73a68b04ed194ed20ef1ee9095929e686bb5096030
5
5
  SHA512:
6
- metadata.gz: 71794fc1da73605fe6cf40d1826d48294f436a61bfec46c03dce370b5093cefa5dec09b3eba8e33434dd13fe0daa57ff1b634e2e42de887075c0f29d820b0122
7
- data.tar.gz: 17f1dc66520907e04a876cd86995ff2619fe46c995a239f6ffe61045cd284d82a24ebcb276501b7fa669163a99c45edb4738fdbbc6f59660a4752fca658ac7c7
6
+ metadata.gz: 7cd6ab22ffb54a834e5d6fe3dd1fdaf2e365fe10c067ffbf08e93351945df6b596648ffb29752044ec9b052d84a8ed98efc82436bdaf91ed1e689dabb41373a5
7
+ data.tar.gz: 282213bd51356480bd66e990be1c98d9da403f6cbfe452768d6ef272292d93b07e9a40b7734f0e06679d41b6dee4ff678d67a747410f2fee62de82884fb60636
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 2.0.5 (2022-08-23)
4
+ - Fix unnecessary double new line in the `karafka.rb` template for Ruby on Rails
5
+ - Fix a case where a manually paused partition would not be processed after rebalance (#988)
6
+ - Increase specs stability.
7
+ - Lower concurrency of execution of specs in Github CI.
8
+
3
9
  ## 2.0.4 (2022-08-19)
4
10
  - Fix hanging topic creation (#964)
5
11
  - Fix conflict with other Rails loading libraries like `gruf` (#974)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.0.4)
4
+ karafka (2.0.5)
5
5
  karafka-core (>= 2.0.2, < 3.0.0)
6
6
  rdkafka (>= 0.12)
7
7
  thor (>= 0.20)
data/bin/integrations CHANGED
@@ -19,7 +19,7 @@ ROOT_PATH = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '../
19
19
  # When the value is high, there's a problem with thread allocation on Github CI, tht is why
20
20
  # we limit it. Locally we can run a lot of those, as many of them have sleeps and do not use a lot
21
21
  # of CPU
22
- CONCURRENCY = ENV.key?('CI') ? 5 : Etc.nprocessors * 2
22
+ CONCURRENCY = ENV.key?('CI') ? 3 : Etc.nprocessors * 2
23
23
 
24
24
  # How may bytes do we want to keep from the stdout in the buffer for when we need to print it
25
25
  MAX_BUFFER_OUTPUT = 51_200
@@ -70,10 +70,15 @@ module Karafka
70
70
  end
71
71
  end
72
72
 
73
- # Trigger method for running on shutdown.
73
+ # Trigger method for running on partition revocation.
74
74
  #
75
75
  # @private
76
76
  def on_revoked
77
+ # We need to always un-pause the processing in case we have lost a given partition.
78
+ # Otherwise the underlying librdkafka would not know we may want to continue processing and
79
+ # the pause could in theory last forever
80
+ resume
81
+
77
82
  coordinator.revoke
78
83
 
79
84
  Karafka.monitor.instrument('consumer.revoked', caller: self) do
@@ -44,6 +44,29 @@ module Karafka
44
44
  end
45
45
  end
46
46
 
47
+ # Trigger method for running on partition revocation.
48
+ #
49
+ # @private
50
+ def on_revoked
51
+ # We do not want to resume on revocation in case of a LRJ.
52
+ # For LRJ we resume after the successful processing or do a backoff pause in case of a
53
+ # failure. Double non-blocking resume could cause problems in coordination.
54
+ resume unless topic.long_running_job?
55
+
56
+ coordinator.revoke
57
+
58
+ Karafka.monitor.instrument('consumer.revoked', caller: self) do
59
+ revoked
60
+ end
61
+ rescue StandardError => e
62
+ Karafka.monitor.instrument(
63
+ 'error.occurred',
64
+ error: e,
65
+ caller: self,
66
+ type: 'consumer.revoked.error'
67
+ )
68
+ end
69
+
47
70
  private
48
71
 
49
72
  # Handles the post-consumption flow depending on topic settings
@@ -74,6 +97,8 @@ module Karafka
74
97
  resume
75
98
  else
76
99
  # If processing failed, we need to pause
100
+ # For long running job this will overwrite the default never-ending pause and will cause
101
+ # the processing th keep going after the error backoff
77
102
  pause(@seek_offset || first_message.offset)
78
103
  end
79
104
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
-
3
2
  <% unless rails? -%>
3
+
4
4
  # This file is auto-generated during the install process.
5
5
  # If by any chance you've wanted a setup for Rails app, either run the `karafka:install`
6
6
  # command again or refer to the install templates available in the source codes
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.0.4'
6
+ VERSION = '2.0.5'
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
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: 2022-08-19 00:00:00.000000000 Z
38
+ date: 2022-08-23 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka-core
metadata.gz.sig CHANGED
Binary file