fix(telemetry): make appender shutdown durable - #2254
Open
7Sageer wants to merge 8 commits into
Open
Conversation
|
commit: |
Own queued and in-flight flushes through shutdown cancellation, replay recoverable spool data when appenders start, and forward one lifecycle budget through the telemetry facade. Refs #2246
7Sageer
force-pushed
the
codex/telemetry-durable-shutdown
branch
from
July 27, 2026 10:32
151d9d9 to
2388e1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #2246
Problem
PR #2230 intentionally limited its scope to wiring cloud telemetry into kap-server. Its server-local close path was bounded and best-effort, but the shared
CloudAppenderstill did not own threshold, periodic, explicit, and shutdown flushes through one lifecycle. A shutdown timeout could therefore stop waiting while remote work continued, without a defined durable handoff or startup recovery path.What changed
CloudAppenderone drain owner for queued and in-flight batches, reject new events once shutdown starts, and make concurrent flush/shutdown calls idempotent.ITelemetryService; later shutdown callers can tighten an active lifecycle.event_idvalues for server-side deduplication.telemetry-v2, leaving the legacy pipeline's spool untouched.Verification:
pnpm test: 15,380 passed; four unrelated 5-second timeouts occurred under full-suite concurrency. The two affected agent-core-v2 files then passed 75/75 in isolation, and the two affected kaos files passed 79/79 with one existing skip.No changeset: this is an internal telemetry lifecycle fix and does not add a user-visible release note. No user documentation update is needed.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.