Commit a84418b
* Fix cleanup deadlock caused by re-entrant lock during HTTP request cancellation
When HCCleanupAsync cancels pending HTTP requests via XAsyncCancel(), the AsyncState
destructor can be invoked synchronously, which attempts to re-acquire the NetworkState
lock (m_mutex) that is already held by CleanupAsyncProvider.
This manifests as a deadlock when cleanup is called with active HTTP requests that have
pending retries. The fix snapshots the active requests while holding the lock, then
releases the lock before calling XAsyncCancel() to avoid re-entrant lock acquisition.
Also applies the same pattern to connected websocket disconnection for consistency.
Fixes deadlock in TestAsyncCleanupWithHttpCallPendingRetry.
* Use xbox:hc:Vector in fix for proper allocation hooking
Previous commit used std::vector, which bypasses the LHC allocation hook
---------
Co-authored-by: Jason Sandlin <jasonsa@microsoft.com>
1 parent b872e39 commit a84418b
1 file changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
382 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
383 | 393 | | |
384 | | - | |
| 394 | + | |
385 | 395 | | |
386 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
387 | 399 | | |
388 | 400 | | |
389 | 401 | | |
390 | 402 | | |
391 | | - | |
| 403 | + | |
392 | 404 | | |
393 | 405 | | |
394 | 406 | | |
| |||
397 | 409 | | |
398 | 410 | | |
399 | 411 | | |
400 | | - | |
401 | 412 | | |
402 | 413 | | |
403 | 414 | | |
| |||
0 commit comments