fix(lading_payload, lading_capture): stop the v04 cache hang and surface capture failures - #1918
Closed
blt wants to merge 2 commits into
Closed
fix(lading_payload, lading_capture): stop the v04 cache hang and surface capture failures#1918blt wants to merge 2 commits into
blt wants to merge 2 commits into
Conversation
…ace capture failures trace-agent v04 block-cache construction could spin for hours when a config's single serialized trace exceeded max_block_size, because to_bytes emitted a 1-byte empty array that construct_block accepted one byte at a time. to_bytes now emits nothing when no trace fits, construction fails fast when even the maximum block cannot be built, and the trace batch grows geometrically to turn the fill loop from O(n^2) into O(n). A capture failure is now a non-zero exit rather than a process abort that skipped the writers' flush and left an unreadable Parquet file. capture_histogram_samples_dropped now counts dropped histogram samples with a bounded reason label, instead of only logging a warning.
The capture writer's close() -- which writes the Parquet footer, without which the file is unreadable -- ran only on the clean-shutdown path. A mid-run error dropped the writer without it, and ChannelClosed exited without draining buffered metrics at all. Add an idempotent StateMachine::close(), drain on ChannelClosed like a shutdown, and have the manager loop close unconditionally after it ends, surfacing a close failure without masking the original error. A capture task JoinError now forces a non-zero exit rather than a clean one with no output. Adds idempotent-close and channel-close-finalizes tests. Also silences clippy::too_many_lines on the (unrelated) v04 fill loop.
This was referenced Jul 21, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 21, 2026
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.

What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Related issues
A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.
Additional Notes
Anything else we should know when reviewing?