karafka-rdkafka 0.13.1 → 0.13.2

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: 826f1e6186cf6d72d7d1460dc33fd1f35c884ee4e1acf8d13c720f3d5324db87
4
- data.tar.gz: 5f975ec4eac686b2f0bb21eebd0ba83a0f7162fedef65a7f7357e6172a5f6498
3
+ metadata.gz: 8d216b3535772b9039cb4f81113f75b1f1262052282c3bb159c78095cddccf3a
4
+ data.tar.gz: ce7e3a921cd0c4a0da1b1d00c4af672949445b0ed05e325c975a3b8533e8a134
5
5
  SHA512:
6
- metadata.gz: 1c9e89a124d065581d0a7b04ec0116ddcc752da454091ce8f0d4df473f0ceb346fae7e3d0169b4b0590222c9a36e9f79a35da6a50d379e2cb66c335690ad40fa
7
- data.tar.gz: 83066cace0c8e9e0e40cf95615db3df46c336c681d1ecb2973d81468f9eb2d106da4250fb35d893e2cc4eba3e5f05ba47baa680beba4887f16a61299499fe875
6
+ metadata.gz: 5acb41af183c6a101c5b7bc88166573c22f2e84516d060b1afb78c6d958b44ffc1b13bcdb08fd8891f16c16ebd6acdabea6c51131d58c30c93e86fe7e3f714dd
7
+ data.tar.gz: a8daa33c897782dfb3875e9e8be078f40ed40a97c926c809f9cb349689d78d1fdeec8bfb70ca1e7a88dadade9f70dcd74ece2e647c30ed3fb855a4dfb3495aa7
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.13.2
2
+ * Ensure operations counter decrement is fully thread-safe
3
+ * Bump librdkafka to 2.1.1
4
+
1
5
  # 0.13.1
2
6
  * Add offsets_for_times method on consumer (timflapper)
3
7
 
@@ -10,6 +10,20 @@ module Rdkafka
10
10
  @access_mutex = Mutex.new
11
11
  # Lock around internal polling
12
12
  @poll_mutex = Mutex.new
13
+ # Lock around decrementing the operations in progress counter
14
+ # We have two mutexes - one for increment (`@access_mutex`) and one for decrement mutex
15
+ # because they serve different purposes:
16
+ #
17
+ # - `@access_mutex` allows us to lock the execution and make sure that any operation within
18
+ # the `#synchronize` is the only one running and that there are no other running
19
+ # operations.
20
+ # - `@decrement_mutex` ensures, that our decrement operation is thread-safe for any Ruby
21
+ # implementation.
22
+ #
23
+ # We do not use the same mutex, because it could create a deadlock when an already
24
+ # incremented operation cannot decrement because `@access_lock` is now owned by a different
25
+ # thread in a synchronized mode and the synchronized mode is waiting on the decrement.
26
+ @decrement_mutex = Mutex.new
13
27
  # counter for operations in progress using inner
14
28
  @operations_in_progress = 0
15
29
 
@@ -45,7 +59,7 @@ module Rdkafka
45
59
 
46
60
  @inner.nil? ? raise(ClosedInnerError) : yield(@inner)
47
61
  ensure
48
- @operations_in_progress -= 1
62
+ @decrement_mutex.synchronize { @operations_in_progress -= 1 }
49
63
  end
50
64
 
51
65
  def synchronize(&block)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rdkafka
4
- VERSION = "0.13.1"
5
- LIBRDKAFKA_VERSION = "2.0.2"
6
- LIBRDKAFKA_SOURCE_SHA256 = "f321bcb1e015a34114c83cf1aa7b99ee260236aab096b85c003170c90a47ca9d"
4
+ VERSION = "0.13.2"
5
+ LIBRDKAFKA_VERSION = "2.1.1"
6
+ LIBRDKAFKA_SOURCE_SHA256 = "7be1fc37ab10ebdc037d5c5a9b35b48931edafffae054b488faaff99e60e0108"
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-rdkafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs Cadier
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2023-06-26 00:00:00.000000000 Z
38
+ date: 2023-06-28 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
metadata.gz.sig CHANGED
Binary file