waterdrop 2.10.11 → 2.10.12

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: ea63c502e1050986468202c5b255aeafb4d120579b8a175534156dc5dd423b39
4
- data.tar.gz: f8c84425802853f77642fbabb63b3ee8b36018d36888ddadb0815e0956105b90
3
+ metadata.gz: fd9b707e1b94c3a746a7e1a90356140feea0f1afda53c6ec022f5fd425320c6a
4
+ data.tar.gz: d12d7af191c351920091538ede0a61dfec5c73624aab27d67c1ec416b75a3ae6
5
5
  SHA512:
6
- metadata.gz: e0983557e2c383ea14a035638f315874ce5a0e5ee830b28618ea2a9a1d42fa046c6b2b726932432ac8c8b842b90f8a887fa494a1da28ef88c632dc50ece22e50
7
- data.tar.gz: f45f7764bc4787d3ad755a8eeef67a2d939192074f941cf672632cd39519f17ea13b47e5a6ee3fb310a64dc52442f41c25644b4714ac83b0fcd25334f2d23c02
6
+ metadata.gz: cfb7ce2c4583f92bc13b9f4fd5fb2592d0284300349309e2b97f5a558838b1d9c7f645ffb2ab20599b1c199ce8e442c81afe4524806dfa75ea42311b8d4aac7b
7
+ data.tar.gz: ddbaccf6d688192a19ae5a6617fa34af76cb9f6fb2c0a1bc83e5c3fb52b55300fe0799c9b7e6f790acbbc2b4534c1c793d4336740c65fe7ffe6d6b9e28c287dc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## v2.10.12 (2026-11-25)
4
+ - [Change] Raise `ConfigurationInvalidError` (`kafka.bootstrap.servers`) on the first produce when `bootstrap.servers` is missing, `nil` or empty, instead of failing with `msg_timed_out` after `message.timeout.ms`. `#close` reports unflushed buffered messages as `producer.close.error`.
5
+ - [Maintenance] Release the code of 2.10.11 again, with a Sigstore attestation. 2.10.11 was published without one: signing failed in the release workflow (the signer does not work with json 3.x, the default of Ruby 4.0) and the attestation patch then pushed the gem unsigned. There are no code changes; use 2.10.12 rather than 2.10.11 for the attested gem.
6
+ - [Maintenance] Sign the gem with `sigstore-cli` and push it with `gem push --attestation` (the `gem-push` action of `karafka/misc`), so a failed signing stops the release instead of publishing the gem without an attestation.
7
+
3
8
  ## v2.10.11 (2026-11-20)
4
9
  - [Feature] Add the `produce` / `produce!`, `produce_many` / `produce_many!`, `tombstone` / `tombstone!`, `tombstone_many` / `tombstone_many!` and `flush` / `flush!` aliases of the `_async` / `_sync` methods.
5
10
  - [Change] Require `karafka-core` `>=` `2.6.8`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (2.10.11)
4
+ waterdrop (2.10.12)
5
5
  karafka-core (>= 2.6.8, < 3.0.0)
6
6
  karafka-rdkafka (>= 0.32.0)
7
7
  zeitwerk (~> 2.3)
@@ -68,7 +68,7 @@ CHECKSUMS
68
68
  ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef
69
69
  simplecov (1.3.2) sha256=2a22ec1759f1b8db60881a2e038758956fc69ef93ed669be0bde0678de6d0e85
70
70
  warning (1.6.0) sha256=a49cdfae19fb77d19afff2efbe45f8ab759e9cd25b4e4ce2c79dbaf46bdb6c9e
71
- waterdrop (2.10.11)
71
+ waterdrop (2.10.12)
72
72
  zeitwerk (2.8.3) sha256=2c85125a8467ce069e20123d1e709a08955c9d29c118c25b46b7b7fafdbb92e5
73
73
 
74
74
  BUNDLED WITH
@@ -12,6 +12,7 @@ en:
12
12
  max_wait_timeout_format: must be an integer that is equal or bigger than 0
13
13
  kafka_format: must be a hash with symbol based keys
14
14
  kafka_key_must_be_a_symbol: All keys under the kafka settings scope need to be symbols
15
+ kafka.bootstrap.servers_format: must be a non-empty string
15
16
  wait_on_queue_full_format: must be boolean
16
17
  wait_backoff_on_queue_full_format: must be a numeric that is equal or bigger to 0
17
18
  wait_timeout_on_queue_full_format: must be a numeric that is equal or bigger to 0
@@ -11,6 +11,11 @@ module WaterDrop
11
11
  # @param producer [WaterDrop::Producer] producer instance with its config, etc
12
12
  # @note We overwrite this that way, because we do not care
13
13
  def new(producer)
14
+ Contracts::KafkaConfig.new.validate!(
15
+ { kafka: producer.config.kafka.to_h },
16
+ Errors::ConfigurationInvalidError
17
+ )
18
+
14
19
  monitor = producer.config.monitor
15
20
  kafka_config, statistics_enabled = prepare_statistics(
16
21
  producer.config.kafka.to_h,
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WaterDrop
4
+ module Contracts
5
+ # Contract with validation rules for the kafka settings the rdkafka client needs to connect.
6
+ # It runs when the rdkafka client is built, not on setup, so producers with other clients
7
+ # (`Buffered`, `Dummy`, test clients) do not need a reachable cluster config.
8
+ class KafkaConfig < ::Karafka::Core::Contractable::Contract
9
+ configure do |config|
10
+ config.error_messages = YAML.safe_load_file(
11
+ File.join(WaterDrop.gem_root, "config", "locales", "errors.yml")
12
+ ).fetch("en").fetch("validations").fetch("config")
13
+ end
14
+
15
+ nested(:kafka) do
16
+ required(:"bootstrap.servers") { |val| val.is_a?(String) && !val.empty? }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -172,9 +172,10 @@ module WaterDrop
172
172
  requeue_unflushed(transactional? ? data_for_dispatch : data_for_dispatch.drop(e.dispatched.size))
173
173
 
174
174
  raise
175
- rescue Errors::MessageInvalidError
176
- # Validation runs before anything is dispatched, so nothing reached librdkafka. Restore the
177
- # whole batch instead of dropping valid messages alongside the invalid one.
175
+ rescue Errors::MessageInvalidError, Errors::ConfigurationInvalidError
176
+ # Validation (of messages, or of the kafka config when the client is built) runs before
177
+ # anything is dispatched, so nothing reached librdkafka. Restore the whole batch instead of
178
+ # dropping valid messages.
178
179
  requeue_unflushed(data_for_dispatch)
179
180
 
180
181
  raise
@@ -459,6 +459,15 @@ module WaterDrop
459
459
  flush_buffer(true)
460
460
  rescue Errors::ProduceError
461
461
  nil
462
+ rescue Errors::ConfigurationInvalidError => e
463
+ # The client could not be built (invalid kafka config), so nothing was dispatched and
464
+ # nothing reported it yet.
465
+ @monitor.instrument(
466
+ "error.occurred",
467
+ producer_id: id,
468
+ error: e,
469
+ type: "producer.close.error"
470
+ )
462
471
  end
463
472
 
464
473
  # We should not close the client in several threads the same time
@@ -2,5 +2,5 @@
2
2
 
3
3
  module WaterDrop
4
4
  # Current WaterDrop version
5
- VERSION = "2.10.11"
5
+ VERSION = "2.10.12"
6
6
  end
data/renovate.json CHANGED
@@ -53,13 +53,6 @@
53
53
  "ruby/setup-ruby"
54
54
  ],
55
55
  "minimumReleaseAge": "5 days"
56
- },
57
- {
58
- "description": "Major updates stay manual",
59
- "matchUpdateTypes": [
60
- "major"
61
- ],
62
- "automerge": false
63
56
  }
64
57
  ],
65
58
  "minimumReleaseAge": "7 days",
@@ -72,8 +65,6 @@
72
65
  "before 4am on the first day of the month"
73
66
  ]
74
67
  },
75
- "automerge": true,
76
- "platformAutomerge": true,
77
68
  "osvVulnerabilityAlerts": true,
78
69
  "vulnerabilityAlerts": {
79
70
  "labels": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waterdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.11
4
+ version: 2.10.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -92,6 +92,7 @@ files:
92
92
  - lib/waterdrop/connection_pool.rb
93
93
  - lib/waterdrop/contracts.rb
94
94
  - lib/waterdrop/contracts/config.rb
95
+ - lib/waterdrop/contracts/kafka_config.rb
95
96
  - lib/waterdrop/contracts/message.rb
96
97
  - lib/waterdrop/contracts/poller_config.rb
97
98
  - lib/waterdrop/contracts/tombstone.rb