Skip to content

Backport WaitTimer lifetime fixes to stable for PS5 manual queues - #1014

Merged
PushpadantK merged 3 commits into
stablefrom
user/pkacha/projectFlair-waittimer-lifetime-stable
Aug 10, 2026
Merged

Backport WaitTimer lifetime fixes to stable for PS5 manual queues#1014
PushpadantK merged 3 commits into
stablefrom
user/pkacha/projectFlair-waittimer-lifetime-stable

Conversation

@PushpadantK

@PushpadantK PushpadantK commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Backport #1005 (0650991, WaitTimer teardown/wrapper lifetime races) onto stable after #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 stable at 18ad77b; stable had 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 distinct std::mutex-derived type on PS5. std::condition_variable cannot wait on unique_lock<DefaultUnnamedMutex>, so the three paired WaitTimer condition variables use DefaultUnnamedConditionVariableAny. This preserves unnamed PS5 synchronization objects.

New regression

manual-queue-timer-retirement-linux combines the internal deterministic retirement hook with public XTaskQueueCreate(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 runs ctest -L taskqueue immediately after the static build.

Validation (exact final head)

  • Final PR head: b3a848e (18ad77b + Fix WaitTimer teardown and wrapper lifetime races #1005 + PS5 integration + regression).
  • Linux static build: PASS.
  • ctest -L taskqueue: 6/6 PASS:
    • taskqueue-starvation-linux
    • taskqueue-poll-strand-linux
    • waittimer-queue-teardown-linux
    • waittimer-queue-retirement-linux
    • manual-queue-timer-retirement-linux
    • waittimer-wrapper-terminate-linux
  • New public retirement regression repeated 500 times: 500/500 PASS.
  • Linux shared build: PASS (internal-hook test correctly excluded).
  • Windows v143 Win32 x64 target: PASS. Full solution additionally requires unavailable local UWP/TAEF workloads.
  • PS5 libHttpClient.Playstation.sln Debug|Prospero rebuild: PASS (libHttpClient.prx, PavoTestApp).
  • Full PlayFab Multiplayer PS5 release topology rebuild: PASS (libHttpClient.prx, libPlayFabMultiplayer.prx, MultiplayerTool.elf).
  • PS5 hardware public-API stress: 2,000 concurrent old-queue close/new Manual/Manual queue creation cycles; delayed callback dispatched on every replacement; clean PRX unload; PASS.
  • MultiplayerTool Lobby: PS5 Client00 + GameCorePC Client01; 58 passed, 8 skipped, 0 failed; 69 clean PFMultiplayer/PubSub shutdown cycles; PS5 remained alive; PASS.

No PubSub-layer defensive changes are included.

James Hugard (jhugard) and others added 3 commits August 10, 2026 13:55
* 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
PushpadantK force-pushed the user/pkacha/projectFlair-waittimer-lifetime-stable branch from 983df8b to b3a848e Compare August 10, 2026 21:59
@PushpadantK
PushpadantK merged commit 037f219 into stable Aug 10, 2026
2 checks passed
@PushpadantK
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants