Studio: include the backend session log in the support diagnostics report - #8877
Open
LeoBorcherding wants to merge 1 commit into
Open
Studio: include the backend session log in the support diagnostics report#8877LeoBorcherding wants to merge 1 commit into
LeoBorcherding wants to merge 1 commit into
Conversation
…port The Python backend aims faulthandler at ~/.unsloth/studio/logs/server/, so a native abort in the GPU runtime writes its stack there and in no other file Studio keeps. The report collected tauri.log and the phase logs but never that directory, so a hard crash arrived as an exit code with nothing about the call that died. Tail the two newest server-*.log alongside the existing sections. Their budget is smaller than the other tails on purpose: enforce_report_limit chops the end of the body, so bytes spent here would come out of the phase logs, and a faulthandler dump is a few KB at the end of the file, which is the half read_tail returns.
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.
Context: the Windows ROCm / Strix Halo crash reported on Reddit (same host as #8853). This does not fix that crash — it makes the next report of it diagnosable.
Problem
The Python backend aims faulthandler at
~/.unsloth/studio/logs/server/(studio/backend/run.py:1850), so when the GPU runtime aborts, the Python stack naming the call that died is written there and in no other file Studio keeps.The support report's
== Log tails ==section collectedtauri.log,tauri.log.1and the phase logs, and never that directory. A hard native crash therefore arrives asexit code: 3with nothing about what the process was doing, while the one file that answers it sits on the user's disk unasked-for. That is exactly how the linked report played out: seven minutes of healthy polling, the model dropdown's request fan-out all returning 200, thenBackend stdout stream ended with status: exit code: 3with no traceback and no[stderr]line.Change
Tail the two newest
server-*.logalongside the existing sections, labelledsource=backend-session-log. Two files, so a crash and the restart that followed it both land in one report. An absent directory reportsbackend_session_logs=unavailablerather than erroring — a--no-torchhost, or one withUNSLOTH_STUDIO_NO_FILE_LOG=1, simply has none.They get a smaller budget than the other tails (64 KiB / 400 lines vs 200 KiB / 1000).
enforce_report_limittruncates the end of the body, so bytes spent in a section inserted here come straight out of the phase logs below it. A faulthandler dump is a few KB at the end of the file, which is the halfread_tailreturns, so the smaller cap loses nothing that matters.append_tail_sectionkeeps its signature and delegates to a_cappedvariant; no existing call site changes behaviour.Testing
Four new tests in
diagnostics::report::tests:server-*.logis collected (tauri.log,server-notes.txtignored)Both behaviours mutation-tested: flipping the sort to ascending, and raising
SERVER_LOG_TAIL_MAX_BYTEStoTAIL_MAX_BYTES, each fail the suite.cargo test --bins: 367 passed.cargo fmt --checkis clean on the changed file (the tree has pre-existing diffs elsewhere, left alone).Privacy: the new tails go through the same
redact_textpass as every other section;report_redacts_footer_collection_warning_pathscovers home-path masking.