Order safe-crash-log records within task-backtrace dumps#280
Open
charnik wants to merge 8 commits into
Open
Conversation
Adds backtrace_id and backtrace_line attributes to safe-crash-log records emitted during jl_print_task_backtraces, so observability platforms can deterministically order records that share a millisecond timestamp and distinguish separate dumps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
No existing test exercises jl_print_task_backtraces, the heartbeat mechanism, or the safe-crash-log path. The full test is preserved in the plan as a trace in case a reviewer requests it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Records emitted while a thread is inside jl_print_task_backtraces now carry backtrace_id (unique per dump) and backtrace_line (gap-free, 0-based ordinal within the dump), so observability platforms can order records that share a millisecond timestamp and group them by dump. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds two attributes to safe-crash-log JSON records emitted while a thread is inside
jl_print_task_backtraces:backtrace_id— unique per dump, distinguishing dumps at different times.backtrace_line— gap-free, 0-based ordinal within a dump.Why
The crash-log timestamp has only millisecond precision. A single backtrace dump emits many records in well under a millisecond, so successive records routinely share an identical timestamp and observability platforms may present
them in an arbitrary order, making the dumped backtrace hard to read. These attributes let a consumer deterministically reconstruct record order and group records by dump.
Behavior change
Only records emitted during a dump gain the attributes; all other safe-crash-log records (heartbeat-loss messages, signal-handler output) keep their current JSON shape. The file remains one JSON object per line.
Notes
juliawith the argument--safe-crash-log-file=crash.out, then callingccall(:jl_heartbeat_enable, Cint, (Cint,Cint,Cint), 1, 1, 10), and finally inspecting the contents ofcrash.out.Closes RAI-52127.