karafka-rdkafka 0.14.9 → 0.14.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/dist/librdkafka_2.3.0.tar.gz +0 -0
- data/ext/Rakefile +11 -1
- data/karafka-rdkafka.gemspec +2 -2
- data/lib/rdkafka/bindings.rb +2 -0
- data/lib/rdkafka/config.rb +24 -7
- data/lib/rdkafka/version.rb +1 -1
- data/spec/rdkafka/config_spec.rb +20 -0
- data/spec/rdkafka/consumer_spec.rb +5 -0
- data.tar.gz.sig +0 -0
- metadata +5 -3
- metadata.gz.sig +2 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46b697b4fffd0a92901c4ba71c41fe81627828a2146f2f9a4bfb7f6127de44b9
|
4
|
+
data.tar.gz: 430bb67bd7de9c7aad6abc037d091aac9dd45b96146e0fc01d0b83e7c9fa0e1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee0329ac06eee8cd12d9ce7c0707dc097d73346d176e9e846621c575fc6fb7a199a8b44136ed07c685fe36bd0b51eb259440aaf21bc502e3b0a951d4481f5376
|
7
|
+
data.tar.gz: 5b55d118468203c5ea367d8b3902cb37baa018f8f0147b7ed5c2eb3d496a56641e3d3f238d90f2a0d9bcabbbf445158dfb6f185c7878882212d9ead56ec09026
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Rdkafka Changelog
|
2
2
|
|
3
|
+
## 0.14.11 (2024-07-10)
|
4
|
+
- [Fix] Switch to local release of librdkafka to mitigate its unavailability.
|
5
|
+
|
6
|
+
## 0.14.10 (2024-02-08)
|
7
|
+
- [Fix] Background logger stops working after forking causing memory leaks (mensfeld).
|
8
|
+
|
3
9
|
## 0.14.9 (2024-01-29)
|
4
10
|
- [Fix] Partition cache caches invalid `nil` result for `PARTITIONS_COUNT_TTL`.
|
5
11
|
- [Enhancement] Report `-1` instead of `nil` in case `partition_count` failure.
|
Binary file
|
data/ext/Rakefile
CHANGED
@@ -22,11 +22,21 @@ task :default => :clean do
|
|
22
22
|
ENV["LDFLAGS"] = "-L#{homebrew_prefix}/lib" unless ENV["LDFLAGS"]
|
23
23
|
end
|
24
24
|
|
25
|
+
releases = File.expand_path(File.join(File.dirname(__FILE__), '../dist'))
|
26
|
+
|
25
27
|
recipe.files << {
|
26
|
-
:url => "
|
28
|
+
:url => "file://#{releases}/librdkafka_#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz",
|
27
29
|
:sha256 => Rdkafka::LIBRDKAFKA_SOURCE_SHA256
|
28
30
|
}
|
29
31
|
recipe.configure_options = ["--host=#{recipe.host}"]
|
32
|
+
|
33
|
+
# Disable using libc regex engine in favor of the embedded one
|
34
|
+
# The default regex engine of librdkafka does not always work exactly as most of the users
|
35
|
+
# would expect, hence this flag allows for changing it to the other one
|
36
|
+
if ENV.key?('RDKAFKA_DISABLE_REGEX_EXT')
|
37
|
+
recipe.configure_options << '--disable-regex-ext'
|
38
|
+
end
|
39
|
+
|
30
40
|
recipe.cook
|
31
41
|
# Move dynamic library we're interested in
|
32
42
|
if recipe.host.include?('darwin')
|
data/karafka-rdkafka.gemspec
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
require File.expand_path('lib/rdkafka/version', __dir__)
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
|
-
gem.authors = ['Thijs Cadier']
|
6
|
+
gem.authors = ['Thijs Cadier', 'Maciej Mensfeld']
|
7
7
|
gem.email = ["contact@karafka.io"]
|
8
8
|
gem.description = "Modern Kafka client library for Ruby based on librdkafka"
|
9
|
-
gem.summary = "The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka. It wraps the production-ready C client using the ffi gem and targets Kafka 1.0+ and Ruby 2.
|
9
|
+
gem.summary = "The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka. It wraps the production-ready C client using the ffi gem and targets Kafka 1.0+ and Ruby 2.7+."
|
10
10
|
gem.license = 'MIT'
|
11
11
|
|
12
12
|
gem.files = `git ls-files`.split($\)
|
data/lib/rdkafka/bindings.rb
CHANGED
data/lib/rdkafka/config.rb
CHANGED
@@ -15,13 +15,12 @@ module Rdkafka
|
|
15
15
|
@@opaques = ObjectSpace::WeakMap.new
|
16
16
|
# @private
|
17
17
|
@@log_queue = Queue.new
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
18
|
+
# @private
|
19
|
+
# We memoize thread on the first log flush
|
20
|
+
# This allows us also to restart logger thread on forks
|
21
|
+
@@log_thread = nil
|
22
|
+
# @private
|
23
|
+
@@log_mutex = Mutex.new
|
25
24
|
|
26
25
|
# Returns the current logger, by default this is a logger to stdout.
|
27
26
|
#
|
@@ -30,6 +29,24 @@ module Rdkafka
|
|
30
29
|
@@logger
|
31
30
|
end
|
32
31
|
|
32
|
+
# Makes sure that there is a thread for consuming logs
|
33
|
+
# We do not spawn thread immediately and we need to check if it operates to support forking
|
34
|
+
def self.ensure_log_thread
|
35
|
+
return if @@log_thread && @@log_thread.alive?
|
36
|
+
|
37
|
+
@@log_mutex.synchronize do
|
38
|
+
# Restart if dead (fork, crash)
|
39
|
+
@@log_thread = nil if @@log_thread && !@@log_thread.alive?
|
40
|
+
|
41
|
+
@@log_thread ||= Thread.start do
|
42
|
+
loop do
|
43
|
+
severity, msg = @@log_queue.pop
|
44
|
+
@@logger.add(severity, msg)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
33
50
|
# Returns a queue whose contents will be passed to the configured logger. Each entry
|
34
51
|
# should follow the format [Logger::Severity, String]. The benefit over calling the
|
35
52
|
# logger directly is that this is safe to use from trap contexts.
|
data/lib/rdkafka/version.rb
CHANGED
data/spec/rdkafka/config_spec.rb
CHANGED
@@ -22,6 +22,7 @@ describe Rdkafka::Config do
|
|
22
22
|
it "supports logging queue" do
|
23
23
|
log = StringIO.new
|
24
24
|
Rdkafka::Config.logger = Logger.new(log)
|
25
|
+
Rdkafka::Config.ensure_log_thread
|
25
26
|
|
26
27
|
Rdkafka::Config.log_queue << [Logger::FATAL, "I love testing"]
|
27
28
|
20.times do
|
@@ -31,6 +32,25 @@ describe Rdkafka::Config do
|
|
31
32
|
|
32
33
|
expect(log.string).to include "FATAL -- : I love testing"
|
33
34
|
end
|
35
|
+
|
36
|
+
it "expect to start new logger thread after fork and work" do
|
37
|
+
reader, writer = IO.pipe
|
38
|
+
|
39
|
+
pid = fork do
|
40
|
+
$stdout.reopen(writer)
|
41
|
+
Rdkafka::Config.logger = Logger.new($stdout)
|
42
|
+
reader.close
|
43
|
+
producer = rdkafka_producer_config(debug: 'all').producer
|
44
|
+
producer.close
|
45
|
+
writer.close
|
46
|
+
sleep(1)
|
47
|
+
end
|
48
|
+
|
49
|
+
writer.close
|
50
|
+
Process.wait(pid)
|
51
|
+
output = reader.read
|
52
|
+
expect(output.split("\n").size).to be >= 20
|
53
|
+
end
|
34
54
|
end
|
35
55
|
|
36
56
|
context "statistics callback" do
|
@@ -211,6 +211,11 @@ describe Rdkafka::Consumer do
|
|
211
211
|
|
212
212
|
# 7. ensure same message is read again
|
213
213
|
message2 = consumer.poll(timeout)
|
214
|
+
|
215
|
+
# This is needed because `enable.auto.offset.store` is true but when running in CI that
|
216
|
+
# is overloaded, offset store lags
|
217
|
+
sleep(1)
|
218
|
+
|
214
219
|
consumer.commit
|
215
220
|
expect(message1.offset).to eq message2.offset
|
216
221
|
expect(message1.payload).to eq message2.payload
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka-rdkafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thijs Cadier
|
8
|
+
- Maciej Mensfeld
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain:
|
@@ -35,7 +36,7 @@ cert_chain:
|
|
35
36
|
AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
|
36
37
|
msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
|
37
38
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
39
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
39
40
|
dependencies:
|
40
41
|
- !ruby/object:Gem::Dependency
|
41
42
|
name: ffi
|
@@ -185,6 +186,7 @@ files:
|
|
185
186
|
- README.md
|
186
187
|
- Rakefile
|
187
188
|
- certs/cert_chain.pem
|
189
|
+
- dist/librdkafka_2.3.0.tar.gz
|
188
190
|
- docker-compose.yml
|
189
191
|
- ext/README.md
|
190
192
|
- ext/Rakefile
|
@@ -282,7 +284,7 @@ signing_key:
|
|
282
284
|
specification_version: 4
|
283
285
|
summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
|
284
286
|
It wraps the production-ready C client using the ffi gem and targets Kafka 1.0+
|
285
|
-
and Ruby 2.
|
287
|
+
and Ruby 2.7+.
|
286
288
|
test_files:
|
287
289
|
- spec/rdkafka/abstract_handle_spec.rb
|
288
290
|
- spec/rdkafka/admin/create_acl_handle_spec.rb
|
metadata.gz.sig
CHANGED
@@ -1,4 +1,2 @@
|
|
1
|
-
�v
|
2
|
-
|
3
|
-
�y�(c�s�dA���,�
|
4
|
-
F(���
|
1
|
+
6.��(����:��c�i����������^�9�ty��z CF�����������1��0]Q�@��+*�=E���v=!5 �jb�('#����U�gXNC�iƮ�ij�[e������s�'"N.�X�"C�����Z4�s/4k��1>E�n$��}Q/KaϽ��k;����*
|
2
|
+
�֤�[�a�\�J��Z#A��wK�cm����k6��w���^�sQR�!�3.�"E&!�f��Z���u:0�����r��;�Yf�lP�RK�W�1��6w�u��ۃ(r��'�َԟ�x�ԁ�r��D��|���;E��H���!�6�+/̧�a�3U��v̈́!�i�/,߶p��wl��X*0���I�sPnǵ�
|