rdkafka 0.13.0.beta.8 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e774c8eb7ac27fd5d89e3b28e5786bfbbc1354e7a35da0d89e7e1ebc488c0b80
4
- data.tar.gz: d21b5a39de5fd22e38e9d2342a984c552b317d525a67d4128a9c78a07e0b1737
3
+ metadata.gz: b4b1881445c53cdd213efd2e7ed3feb94a32a327fdf63ab35455d337f09e7320
4
+ data.tar.gz: 02276df9702539c951ab392b4c5e086f87b731f7d319aedafb7b1209bc444688
5
5
  SHA512:
6
- metadata.gz: 0cb979f4cc0a693f183e817fad944f8f24f09190ccd5d6363f3df9696441ef8b76056e05286f0214443095cd8b11b2abf9e3b8223d73a43bc09583dbab9b90dc
7
- data.tar.gz: dded899763cf50da00fda25dcb03974946ccc0199eaececa2f20bc043971e3bf8a14c85610258f207424f8b76c69eac1a025f1e4b30297a2eedd4937ca705dee
6
+ metadata.gz: 7f0e11a17d03091c8e13308c6998131c142349ce520473de7fec5908f0bcf2dfd59542966c3a850008f0db39e96b763b66f7b937487ba11f2fbb444e00aff25c
7
+ data.tar.gz: d15c5f7cd5f4b9041da55e7e46bf05936c627517d5067a9449844e2721e752de852006f432e5fbe72549d77d8378545a671a969652b4abada8aa8182f4fa4985
@@ -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.0.beta.8"
4
+ VERSION = "0.13.0"
5
5
  LIBRDKAFKA_VERSION = "2.0.2"
6
6
  LIBRDKAFKA_SOURCE_SHA256 = "f321bcb1e015a34114c83cf1aa7b99ee260236aab096b85c003170c90a47ca9d"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdkafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0.beta.8
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs Cadier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-21 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -216,9 +216,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
216
216
  version: '2.6'
217
217
  required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  requirements:
219
- - - ">"
219
+ - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: 1.3.1
221
+ version: '0'
222
222
  requirements: []
223
223
  rubygems_version: 3.4.1
224
224
  signing_key: