fix(agc): bound the async log's exit flush #6800
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6800"
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?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T12:30:29Z.
What
Main fix.
AsyncLog(#6371) registersstd::atexit([] { Get().Flush(); }), an unbounded wait for the logger thread.libSceAgcDriveris a DLL on Windows, and a DLL'satexithandlers run atDLL_PROCESS_DETACH, afterExitProcesshas ended every other thread. If lines are still queued then, the logger thread is gone andFlushwaits forever.guest_shader_linkon Windows either passes in ~0.03 s or times out at 120 s. It timed out on 4 of the last 7 completed main push builds (38885843235, 38892071250, 38892996281, 38896166619), all after #6371, and never before. The handler now runsFlushAtEnd, the bounded flush (FlushFor, 2 s, lock-free) thatAsyncLogalready registers forabort,terminateand_Exit.docs/dev/ARCHITECTURE.mdnow says which flush runs at exit and why.Tested
Linux: the header compiles (
g++ -std=c++20 -fsyntax-onlyontests/AsyncLog.cpp). Windows can't be run here. Merged as a quick main fix without the full Build; main's next Windows push builds are the proof. Because the hang is intermittent, the proof isguest_shader_linkgreen on several consecutive Windows builds, not just one.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)