Order safe-crash-log records within task-backtrace dumps#280
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>
|
Babis the general idea here makes sense to me, but i'm not working on our julia code for the next few quarters or so. This should be reviewed by someone in the logic reasoner team, if possible. I can help if it's absolutely needed, but for routine work I'd like to keep myself removed. Thank you for the change! ❤️ |
Thanks @NHDaly for stating your availability. That's good to know. I had already requested a review from @andrebsguedes because I did not know when your paternity leave would end! |
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.