Skip to content

[pull] master from DataDog:master - #662

Merged
pull[bot] merged 2 commits into
ConnectionMaster:masterfrom
DataDog:master
Jul 16, 2026
Merged

[pull] master from DataDog:master#662
pull[bot] merged 2 commits into
ConnectionMaster:masterfrom
DataDog:master

Conversation

@pull

@pull pull Bot commented Jul 16, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

piochelepiotr and others added 2 commits July 15, 2026 21:16
#24552)

* kafka_consumer: reuse AdminClient and Consumer across runs

Recreating the librdkafka AdminClient (close_admin_client defaulted to true) and
opening/closing a Consumer on every run tore down and respawned librdkafka's
per-broker threads each collection. On high-core hosts that spreads allocations
across many glibc arenas whose freed memory is never reused or returned, so agent
RSS climbs unbounded. Keep both clients alive (default close_admin_client to
false, make open_consumer idempotent, and stop closing the consumer used for
cluster-id detection) so the same threads and arenas are reused each run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add changelog entry for connection reuse

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Drop inline rationale comments (kept in PR/changelog)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Guard consumer reuse under close_admin_client flag

close_admin_client now controls reuse of both clients: when false (default) the
AdminClient and Consumer are both reused across runs; when true, both are closed
each run (previous behavior).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Drop explanatory comment on consumer close guard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Keep close_admin_client default unchanged (true)

Reuse of both clients is opt-in via close_admin_client: false; the default
behavior (closing clients each run) is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Reword changelog: reuse is opt-in via close_admin_client

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…24515)

* kafka_consumer: cache earliest offsets across collection intervals

Log start offsets only move via the broker's log-cleaner cycle
(log.retention.check.interval.ms), so refetching them on every check
run is unnecessary broker load. Cache the result with a TTL derived
from that broker config, clamped to a sane range.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add changelog entry

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* kafka_consumer: trim redundant comments, add earliest-offsets cache test

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Address review feedback: avoid an undocumented metric and refetch missing partitions on a fresh cache

log.retention.check.interval.ms is now read from broker config data purely to
derive the earliest-offsets cache TTL, without being added to the metric
emission list. fetch_earliest_offsets also now refetches from the broker when
a fresh cache doesn't cover every requested partition (e.g. newly added
partitions), while keeping the cache's original expiration.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Jul 16, 2026
@pull pull Bot added the ⤵️ pull label Jul 16, 2026
@pull
pull Bot merged commit 7be739d into ConnectionMaster:master Jul 16, 2026
1 check passed
@pull
pull Bot had a problem deploying to typo-squatting-release July 16, 2026 05:40 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant