core(logging): offload stderr/file log writes to dedicated background thread #129
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!129
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/129/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Androtim on GitHub · 2026-11-29 13:37 UTC · original
Androtim:feat/iter130-logging-background-writer-thread→main· +160 −14 · 1 files · 1 commits · merged 2026-11-29 14:10 UTCSummary
VICTORY_LOG_FILEwrites onto a dedicatedvictory-logbackground thread fed via a boundedsync_channel(16,384lines) incrates/victory-core/src/logging.rs, preventing submitting and title threads from blocking when log readers stall on 5-second telemetry bursts.DROPPEDand report them on the writer thread once it drains; preserve synchronous inline writes whenVICTORY_LOG_SYNC=1(or if spawning the writer thread fails).queued_lines_deliver_and_full_queues_count_drops_without_blockingunit test.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy:asset policy: 303 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-core --lib --locked: 14 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warningsand--features diagnostics: 0 code warnings@Androtim on GitHub · 2026-11-29 14:07 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
merge-candidate· CI (check):passingReview Summary
crates/victory-core/src/logging.rscleanly offloads stderr andVICTORY_LOG_FILEwrites to a dedicatedvictory-logthread fed by a boundedstd::sync::mpsc::sync_channel(QUEUE = 16_384), preserving thepub fn init(default_level: &str)API and providing an opt-out viaVICTORY_LOG_SYNC=1(as well as a synchronous fallback ininit_syncif spawning the thread fails).Queued::make_writerreturns aLinebuffer whoseDropusesSyncSender::try_send, incrementingDROPPEDonFull/Disconnectedwithout blocking calling threads.try_init()fails (e.g. subscriber already initialized), theSyncSenders are dropped andwrite_linesexits cleanly.queued_lines_deliver_and_full_queues_count_drops_without_blockingexercises both delivery and non-blocking drop accounting.Minor Non-Blocking Notes
victory-logthread is detached and the global tracing subscriber holds theSyncSenders for the process lifetime, lines still queued in the channel at exit may not be flushed (for short-lived runs or fatal diagnostics,VICTORY_LOG_SYNC=1remains available).write_linesservices bothTo::ConsoleandTo::Fileon one thread, so a prolonged console pipe stall will also delayVICTORY_LOG_FILEwrites until the queue fills; additionally, checkingDROPPED.swap(0, Ordering::Relaxed)on every popped line can emit a[log] ... lines droppedline after each item during sustained saturation.No blockers found; looks ready as a merge candidate pending maintainer review.
Generated with Antigravity CLI (
agy).