Backport WaitTimer lifetime fixes to stable for PS5 manual queues - #1014
Merged
PushpadantK merged 3 commits intoAug 10, 2026
Merged
Conversation
* Add deterministic STL WaitTimer teardown repro * Fix STL WaitTimer queue teardown lifetime * Add WaitTimer wrapper termination repro * Serialize WaitTimer wrapper termination (cherry picked from commit 0650991)
WaitTimer #1005 protects its state with DefaultUnnamedMutex. On stable, #1011 makes that a distinct std::mutex-derived type on PS5, so std::condition_variable cannot accept unique_lock<DefaultUnnamedMutex>. Use DefaultUnnamedConditionVariableAny for the three WaitTimer condition variables paired with DefaultUnnamedMutex. This preserves unnamed PS5 synchronization objects and compiles on both PS5 and STL platforms.
Combine the deterministic WaitTimer retirement hook with public XTaskQueueCreate(Manual, Manual), queue destruction, replacement creation, and delayed dispatch. This covers components that recreate private task queues during lifecycle resets and ensures the replacement queue cannot adopt a retiring process-wide timer worker.
PushpadantK
force-pushed
the
user/pkacha/projectFlair-waittimer-lifetime-stable
branch
from
August 10, 2026 21:59
983df8b to
b3a848e
Compare
PushpadantK
deleted the
user/pkacha/projectFlair-waittimer-lifetime-stable
branch
August 10, 2026 22:03
PushpadantK
added a commit
that referenced
this pull request
Aug 11, 2026
* Use unnamed synchronization objects on PS5 (#1011) Co-authored-by: Pushpadant Kacha <pkacha@microsoft.com> * Backport WaitTimer lifetime fixes to stable for PS5 manual queues (#1014) * Fix WaitTimer teardown and wrapper lifetime races (#1005) * Add deterministic STL WaitTimer teardown repro * Fix STL WaitTimer queue teardown lifetime * Add WaitTimer wrapper termination repro * Serialize WaitTimer wrapper termination (cherry picked from commit 0650991) * Integrate WaitTimer lifetime fix with PS5 unnamed mutexes WaitTimer #1005 protects its state with DefaultUnnamedMutex. On stable, #1011 makes that a distinct std::mutex-derived type on PS5, so std::condition_variable cannot accept unique_lock<DefaultUnnamedMutex>. Use DefaultUnnamedConditionVariableAny for the three WaitTimer condition variables paired with DefaultUnnamedMutex. This preserves unnamed PS5 synchronization objects and compiles on both PS5 and STL platforms. * Add public manual-queue timer retirement regression Combine the deterministic WaitTimer retirement hook with public XTaskQueueCreate(Manual, Manual), queue destruction, replacement creation, and delayed dispatch. This covers components that recreate private task queues during lifecycle resets and ensures the replacement queue cannot adopt a retiring process-wide timer worker. --------- Co-authored-by: James Hugard <jhugard@blizzard.com> Co-authored-by: Pushpadant Kacha <pkacha@microsoft.com> --------- Co-authored-by: Pushpadant Kacha <pkacha@microsoft.com> Co-authored-by: James Hugard <jhugard@blizzard.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.
Summary
Backport #1005 (
0650991, WaitTimer teardown/wrapper lifetime races) ontostableafter #1011 (18ad77b, PS5 unnamed synchronization objects), plus the PS5 compatibility integration and a public-XTaskQueue regression for the exact private Manual/Manual queue recreation topology.Why this is the field root cause
A PS5 title still hangs after moving PubSub to a dedicated Manual/Manual queue + pump thread. The title thread waits for PubSub's delayed callback count while the pump waits on an empty active queue. The Flair drop uses
stableat18ad77b;stablehad the timer-arm fixes (#994/#998/#1001) but not #1005's timer teardown/retirement lifetime fixes. #1005's deterministic retirement regression covers the missing case where a replacement timer is initialized while the last old timer queue retires and its callback never dispatches.Stable integration
#1005 uses
DefaultUnnamedMutex; #1011 makes that a distinctstd::mutex-derived type on PS5.std::condition_variablecannot wait onunique_lock<DefaultUnnamedMutex>, so the three paired WaitTimer condition variables useDefaultUnnamedConditionVariableAny. This preserves unnamed PS5 synchronization objects.New regression
manual-queue-timer-retirement-linuxcombines the internal deterministic retirement hook with publicXTaskQueueCreate(Manual, Manual), concurrent old-queue destruction/replacement creation, and delayed dispatch. It is registered in the static build because the hook is intentionally not exported from the shared library; Linux CI runsctest -L taskqueueimmediately after the static build.Validation (exact final head)
b3a848e(18ad77b+ Fix WaitTimer teardown and wrapper lifetime races #1005 + PS5 integration + regression).ctest -L taskqueue: 6/6 PASS:libHttpClient.Playstation.slnDebug|Prospero rebuild: PASS (libHttpClient.prx, PavoTestApp).libHttpClient.prx,libPlayFabMultiplayer.prx,MultiplayerTool.elf).No PubSub-layer defensive changes are included.