[//]: # (This file is auto-generated by bin/refresh_remote_content) [//]: # (Do not edit manually - changes will be overwritten) # Karafka Core Changelog ## Karafka Core Changelog / 2.6.6 (Unreleased) - [Fix] Make `Taggable::Tags` safe to read while another thread adds or removes tags. On JRuby a concurrent read could raise `NullPointerException`. ## Karafka Core Changelog / 2.6.5 (2026-10-19) - **[EOL]** Drop Ruby 3.2 support due to EOL; require Ruby 3.3+. - [Change] Use the offending value (event id, setting name, class or constant name) as the message of errors raised by `Notifications`, `Configurable::Node`, `Configurable::Importer` and the spec locators. ## Karafka Core Changelog / 2.6.4 (2026-09-11) - [Enhancement] Add `Configurable::Importer`, a subclassable base for injecting memoized config readers into a class via `include` or `extend`. ## Karafka Core Changelog / 2.6.3 (2026-08-31) - [Enhancement] Add `Configurable::Injector`, a reusable base for injecting default values into a config hash without overwriting user settings. ## Karafka Core Changelog / 2.6.2 (2026-06-29) - [Enhancement] Document that a setting default is shared across all config instances, so a mutable default such as `[]` must not be changed in place. - [Fix] Require `pathname` explicitly, so `Karafka::Core.gem_root` no longer raises `NameError` when nothing else loaded it. - [Enhancement] Document that a `virtual` rule must return a freshly built `Array` of `[path, message]` error pairs on each call; a memoized, shared or frozen array is unsupported. - [Fix] `Configurable::Node#register` now raises the documented "already registered" `ArgumentError` for a name used by an unread lazy-with-constructor setting, which it previously overwrote silently. - [Fix] Stop a rescued error inside `Contractable::Contract.nested` from prefixing its path onto every rule defined afterwards. - [Fix] Report a missing path instead of raising `NoMethodError` when validating a non-Hash root with a 1-key or 2-key rule. - [Fix] Honor `excluded_keys` containing `"cgrp"` in `StatisticsDecorator` `only_keys` mode; the `cgrp` branch lacked the exclusion guard its `brokers` and `topics` siblings have. - [Fix] Guard the patched rdkafka error callback against a null client pointer, which librdkafka can pass early in client construction and which could segfault the process. - [Fix] Resolve fatal errors in the patched rdkafka error callback via `RdkafkaError.build_fatal`, so the real underlying error is reported instead of the generic `ERR__FATAL` marker. - [Fix] A lazy setting declared without a constructor (`setting(:x, lazy: true)`) no longer raises when read; it now behaves like a regular setting backed by its default. - [Fix] Stop `Contract#call` from raising `NoMethodError` when a virtual rule returns `false`. - [Fix] Make `CallbacksManager` thread-safe under concurrent `add`/`delete` during dispatch, so a callback registered or removed while callbacks were firing is no longer lost. - [Fix] Make `Notifications` subscriptions thread-safe, so a listener unsubscribing during dispatch no longer causes the next listener to be skipped. - [Fix] Report a freeze duration (`_fd`) of `0` for statistics keys that first appear mid-stream. - [Fix] Stop an assignment on a frozen `Configurable::Node` from leaving the setting in an inconsistent state. - [Fix] Stop `Configurable::Node#to_h` from raising for an unset setting that uses the `->(default) { ... }` constructor form. - [Fix] Honor `excluded_keys` when combined with `only_keys` in `StatisticsDecorator`. - [Fix] Fix subject path detection in `MinitestLocator` and `RSpecLocator` when the tests root name repeats later in the path. ## Karafka Core Changelog / 2.6.1 (2026-06-15) - [Enhancement] Speed up `Contract#call` by ~1.25–1.4x, the per-message validation path in WaterDrop producers. - [Fix] Report a missing path instead of raising `NoMethodError` when a 3+ key rule path meets a non-Hash intermediate value. - [Change] Reject reserved setting names in `Configurable::Node#setting` and `#register` with an `ArgumentError`, since they could corrupt the node state. - [Enhancement] Speed up `Monitor#instrument` dispatch (~1.2x) on the common no-subscribers path. - [Enhancement] Speed up `Configurable::Node` settings reads (~1.4x flat, ~1.6x nested) on hot paths. - [Enhancement] Reduce object shape variations of config nodes by giving each settings layout its own anonymous `Node` subclass. - [Fix] Symbolize setting names at definition time and on config store writes, so `String` setting names work end to end and cannot corrupt node internal state when they match reserved internal names. - [Change] Config nodes are instances of anonymous `Node` subclasses: `is_a?(Karafka::Core::Configurable::Node)` still holds, but `instance_of?(Node)` is `false` and `node.class.name` is `nil`. - [Change] Assigning a setting on a frozen config node now raises `FrozenError` (previously the write silently mutated internal storage despite the freeze). ## Karafka Core Changelog / 2.6.0 (2026-06-10) - [Enhancement] Add `Node#register` to register keys at runtime on compiled nodes, for dynamic registries (e.g. named clusters) whose setting names are not known at class-load time. - [Enhancement] Enable all opt-in Ruby warning categories via `Warning.categories`, so new ones (e.g. `strict_unused_block` in Ruby 3.4+) are picked up automatically. ## Karafka Core Changelog / 2.5.13 (2026-04-08) - [Enhancement] Extract `decorate_partitions` method from `StatisticsDecorator` to allow subclasses to filter which partitions are decorated (e.g. skip unassigned partitions in a consumer context). ## Karafka Core Changelog / 2.5.12 (2026-04-02) - [Fix] Exclude `test/` directory from gem releases to reduce package size. ## Karafka Core Changelog / 2.5.11 (2026-04-02) - [Enhancement] Specialize `Contract#dig` for common 1-key and 2-key paths to avoid iterator overhead, yielding ~1.5x faster single-key lookups and ~1.45x faster two-key nested lookups. - [Enhancement] Replace `Node#build_accessors` `@local_defs` Array with Hash for O(1) membership checks instead of O(n) `Array#include?`, yielding up to ~5x faster accessor lookups at 50 settings. - [Enhancement] Stop allocating an Array on every `Contract#call` and `#validate!` call (~1.36x faster dispatch). - [Enhancement] Speed up `Notifications#instrument` with multiple listeners (~1.12x faster event dispatch). - [Enhancement] Cache a frozen success `Result` singleton via `Result.success` to eliminate 1 object allocation per successful `Contract#call` on the happy path. - [Enhancement] Speed up `Node#deep_dup` ~14x and cut its allocations from ~620 to ~66 objects for large configs. - [Enhancement] Stop allocating an Array on every `CallbacksManager#call` call. - [Enhancement] Build the `Event` payload hash lazily on `#payload` access, saving one Hash allocation per `Notifications#instrument` call with `#[]` access, for ~1.7x faster event dispatch. - [Enhancement] Speed up `StatisticsDecorator#diff` by ~13% at scale (10 brokers, 20 topics, 2000 partitions). - [Enhancement] Reorder `StatisticsDecorator#diff` type checks to test `Numeric` before `Hash`, matching the ~80% numeric value distribution in librdkafka statistics. - [Enhancement] Support an `only_keys` option in `StatisticsDecorator` to decorate only the listed numeric keys. With `excluded_keys`, this cuts decoration cost from ~80ms to ~8.5ms per call on large clusters. - [Enhancement] Cache `Tags#to_a` (~7x faster reads at 5 tags, ~28x at 20 tags). ## Karafka Core Changelog / 2.5.10 (2026-03-02) - [Enhancement] Introduce `MinitestLocator` helper for minitest/spec subject class auto-discovery from test file paths. ## Karafka Core Changelog / 2.5.9 (2026-03-02) - [Enhancement] Reduce `StatisticsDecorator` allocations from tens of thousands to one per call at scale. - [Enhancement] Inline `StatisticsDecorator#append` and `#suffix_keys_for` into `#diff` to reduce method call overhead by ~96% (from ~915k to ~39k calls at 6400 partitions). - [Enhancement] Support an `excluded_keys` option in `StatisticsDecorator` to skip unused librdkafka statistics subtrees (e.g. broker toppars, window stats), ~28% faster at scale. ## Karafka Core Changelog / 2.5.8 (2025-11-23) - [Enhancement] Memoize `StatisticsDecorator` suffix keys to reduce string allocations (#268). ## Karafka Core Changelog / 2.5.7 (2025-09-28) - [Enhancement] Optimize `Node#deep_dup` to reduce array allocations during configuration deep copying. - [Enhancement] Optimize `Result#initialize` to use shared `EMPTY_HASH` constant for successful validations. - [Enhancement] Optimize `StatisticsDecorator#append` string concatenation to reduce allocations. - [Enhancement] Optimize `Notifications#instrument` payload handling to avoid unnecessary hash merges for empty payloads. - **[EOL]** Remove Ruby 3.1 support due to EOL. ## Karafka Core Changelog / 2.5.6 (2025-09-02) - [Change] Normalize how libs and dependencies are required (no functional change for the end user) - [Change] Set minimum `karafka-rdkafka` on `0.20.0` to support new features and allow for open range as both `waterdrop` and `karafka` manage this. ## Karafka Core Changelog / 2.5.5 (2025-08-04) - [Enhancement] Remove reliance on `Set` class. ## Karafka Core Changelog / 2.5.4 (2025-08-04) - [Fix] Fix old regression on misbehaviour when Object methods are overwritten. ## Karafka Core Changelog / 2.5.3 (2025-08-04) - [Enhancement] Optimize code to mitigate the Ruby performance warning from `Karafka::Core::Configurable::Node` (#208) - [Enhancement] Raise errors on detected Ruby warnings. - [Change] Remove unused Ruby 2.7 code. - [Change] Remove `funding_uri` from the gemspec to minimize double-funding info. ## Karafka Core Changelog / 2.5.2 (2025-06-11) - [Enhancement] Support `#unsubscribe`. - [Enhancement] Allow for providing a root scope path for error keys. - [Fix] Fix a bug where on no errors the result would be an array instead of a hash. - [Fix] Fix spec hanging when Kafka cluster on 9092 is running. ## Karafka Core Changelog / 2.5.1 (2025-05-23) - [Change] Move to trusted-publishers and remove signing since no longer needed. ## Karafka Core Changelog / 2.5.0 (2025-05-21) - [Change] Set minimum `karafka-rdkafka` on `0.19.2` to support new features. ## Karafka Core Changelog / 2.4.11 (2025-03-20) - [Enhancement] Rename internal node `#name` method to `#node_name` so we can use `#name` as the attribute name. ## Karafka Core Changelog / 2.4.10 (2025-03-14) - [Fix] Relax lock on `karafka-rdkafka` ## Karafka Core Changelog / 2.4.9 (2025-03-03) - [Enhancement] Remove `RspecLocator` dependency on `activesupport`. ## Karafka Core Changelog / 2.4.8 (2024-12-26) - [Maintenance] Declare `logger` as a dependency. ## Karafka Core Changelog / 2.4.7 (2024-11-26) - [Fix] Make sure that `karafka-core` works with older versions of `karafka-rdkafka` that do not support macos fork mitigation. ## Karafka Core Changelog / 2.4.6 (2024-11-26) - [Enhancement] Mitigate macos forking issues when librdkafka is not loaded to memory. - [Change] Allow `karafka-rdkafka` `0.18.0`. ## Karafka Core Changelog / 2.4.5 (2024-11-19) - **[EOL]** Drop Ruby `3.0` support according to the EOL schedule. - [Enhancement] Support listeners inspection via `#listeners`. - [Fix] Restore `#available_events` notifications bus method. - [Change] Set minimum `karafka-rdkafka` on `0.17.6` to support new features. ## Karafka Core Changelog / 2.4.4 (2024-07-20) - [Change] Set minimum `karafka-rdkafka` on `0.16.0` to support new features and allow for `0.17.0`. ## Karafka Core Changelog / 2.4.3 (2024-06-18) - [Fix] Use `Object` instead of `BasicObject` for rule result comparison because of Time mismatch with BasicObject. ## Karafka Core Changelog / 2.4.2 (2024-06-17) - [Enhancement] Allow `karafka-rdkafka` `0.16.x` to be used since API compatible. ## Karafka Core Changelog / 2.4.1 (2024-06-17) - [Enhancement] Provide fast-track for events without subscriptions to save on allocations. - [Enhancement] Save memory allocation on each contract rule validation execution. - [Enhancement] Save one allocation per `float_now` + 2-3x performance by using the Posix clock instead of `Time.now.utc.to_f`. - [Enhancement] Use direct `float_millisecond` precision in `monotonic_now` not to multiply by 1000 (allocations and CPU savings). - [Enhancement] Save one array allocation on one instrumentation. - [Enhancement] Allow clearing one event type (dorner). ## Karafka Core Changelog / 2.4.0 (2024-04-26) - **[EOL]** Drop Ruby `2.7` support. - [Enhancement] Provide necessary alterations for custom oauth token callbacks to operate. - [Change] Set minimum `karafka-rdkafka` on `0.15.0` to support new features. ## Karafka Core Changelog / 2.3.0 (2024-01-26) - [Change] Set minimum `karafka-rdkafka` on `0.14.8` to support new features. - [Change] Remove `concurrent-ruby` usage. ## Karafka Core Changelog / 2.2.7 (2023-11-07) - [Change] Set minimum `karafka-rdkafka` on `0.13.9` to support alternative consumer builder. ## Karafka Core Changelog / 2.2.6 (2023-11-03) - [Enhancement] Set backtrace for errors propagated via the errors callbacks. ## Karafka Core Changelog / 2.2.5 (2023-10-31) - **[EOL]** Drop support for Ruby 2.6 due to incompatibilities in usage of `ObjectSpace::WeakMap` - [Change] Set minimum `karafka-rdkafka` on `0.13.8` to support consumer `#position`. ## Karafka Core Changelog / 2.2.4 (2023-10-25) - [Enhancement] Allow for `lazy` evaluated constructors. - [Enhancement] Allow no-arg constructors. ## Karafka Core Changelog / 2.2.3 (2023-10-17) - [Change] Set minimum `karafka-rdkafka` on `0.13.6`. ## Karafka Core Changelog / 2.2.2 (2023-09-11) - [Fix] Reuse previous frozen duration as a base for incoming computation. ## Karafka Core Changelog / 2.2.1 (2023-09-10) - Optimize statistics decorator by minimizing number of new objects created. - Expand the decoration with the `_fd` value: the freeze duration in milliseconds, showing how long a value has not changed. Useful to detect stale values. ## Karafka Core Changelog / 2.2.0 (2023-09-01) - [Maintenance] Update the signing cert (old expired) ## Karafka Core Changelog / 2.1.1 (2023-06-28) - [Change] Set minimum `karafka-rdkafka` on `0.13.1`. ## Karafka Core Changelog / 2.1.0 (2023-06-19) - [Change] Set `karafka-rdkafka` requirement from `>= 0.13.0` to `<= 0.14.0`. - [Change] Remove no longer needed patch. ## Karafka Core Changelog / 2.0.13 (2023-05-26) - Set minimum `karafka-rdkafka` on `0.12.3`. ## Karafka Core Changelog / 2.0.12 (2023-02-23) - Introduce ability to tag certain objects by including the `Karafka::Core::Taggable` module. ## Karafka Core Changelog / 2.0.11 (2023-02-12) - Set minimum `karafka-rdkafka` on `0.12.1`. ## Karafka Core Changelog / 2.0.10 (2023-02-01) - Move `RspecLocator` to core. ## Karafka Core Changelog / 2.0.9 (2023-01-11) - Use `karafka-rdkafka` instead of `rdkafka`. This change is needed to ensure that all consecutive releases are stable and compatible. - Relax Ruby requirement to `2.6`. It does not mean we officially support it but it may work. Go to [Versions Lifecycle and EOL](https://karafka.io/docs/Versions-Lifecycle-and-EOL/) for more details. ## Karafka Core Changelog / 2.0.8 (2023-01-07) - Add `Karafka::Core::Helpers::Time` utility for time reporting. ## Karafka Core Changelog / 2.0.7 (2022-12-18) - Allow for recompilation of config upon injecting new config nodes. - Compile given config scope automatically after it is defined. - Support sub-config merging via their nested definitions. ## Karafka Core Changelog / 2.0.6 (2022-12-07) - Reverse node compilation state tracking removal. ## Karafka Core Changelog / 2.0.5 (2022-12-07) - Move `librdkafka` generic (producer and consumer) patches from WaterDrop here. - Move dependency on `librdkafka` here from both Karafka and WaterDrop to unify management. - Move `CallbacksManager` from WaterDrop because it's shared. ## Karafka Core Changelog / 2.0.4 (2022-11-20) - Disallow publishing events that were not registered. - Fix a potential race condition when adding listeners concurrently from multiple threads. ## Karafka Core Changelog / 2.0.3 (2022-10-13) - Maintenance release. Cert chain update. No code changes. ## Karafka Core Changelog / 2.0.2 (2022-08-01) - Add extracted statistics decorator (#932) ## Karafka Core Changelog / 2.0.1 (2022-07-30) - Fix a case where setting would match a method monkey-patched on an object (#1) causing initializers not to build proper accessors on nodes. This is not the core bug, but still worth handling this case. ## Karafka Core Changelog / 2.0.0 (2022-07-28) - Initial extraction of common components used in the Karafka ecosystem from WaterDrop. --- *Last modified: 2026-10-23 10:49:46*