Skip to content

fix(lading_payload, lading_capture): stop the v04 cache hang and surface capture failures - #1918

Closed
blt wants to merge 2 commits into
blt/generator-hardeningfrom
blt/payload-capture-hardening
Closed

fix(lading_payload, lading_capture): stop the v04 cache hang and surface capture failures#1918
blt wants to merge 2 commits into
blt/generator-hardeningfrom
blt/payload-capture-hardening

Conversation

@blt

@blt blt commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

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?

blt added 2 commits July 21, 2026 20:42
…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.

blt commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant