Commit d9a2cf5
authored
Fix reentrant assert failures in session resumption with custom executions (#5844)
When `MsQuicLib.CustomExecutions` is enabled, all `MsQuicSetParam` calls
execute inline with `Connection->State.InlineApiExecution = TRUE` (see
`api.c:1666`). For `QUIC_PARAM_CONN_RESUMPTION_TICKET`, this triggers a
debug assertion failure at `connection.c:693`:
```c
CXPLAT_DBG_ASSERT(!Connection->State.InlineApiExecution || Connection->State.HandleClosed);
```
The assertion fires because `QuicConnIndicateEvent` is called while
`InlineApiExecution` is `TRUE` and `HandleClosed` is `FALSE`. Two
distinct call paths trigger this:
### Path 1: Via streams-available indication
```
MsQuicSetParam(QUIC_PARAM_CONN_RESUMPTION_TICKET)
-> InlineApiExecution = TRUE
-> QuicConnProcessPeerTransportParameters(FromResumptionTicket=TRUE)
-> QuicStreamSetInitializeTransportParameters(FlushIfUnblocked=FALSE)
-> QuicStreamSetIndicateStreamsAvailable
-> QuicConnIndicateEvent <-- ASSERT
```
### Path 2: Via datagram state change
```
MsQuicSetParam(QUIC_PARAM_CONN_RESUMPTION_TICKET)
-> InlineApiExecution = TRUE
-> QuicConnProcessPeerTransportParameters(FromResumptionTicket=TRUE)
-> QuicDatagramOnSendStateChanged
-> QuicConnIndicateEvent <-- ASSERT
```
## Fix
Relax the assertion to not check app callback reentrancy when custom
execution is enabled, per suggestion by @guhetier.1 parent 5cffb35 commit d9a2cf5
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
696 | 698 | | |
697 | 699 | | |
698 | 700 | | |
699 | | - | |
| 701 | + | |
| 702 | + | |
700 | 703 | | |
701 | 704 | | |
702 | 705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
474 | 476 | | |
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
479 | | - | |
| 481 | + | |
| 482 | + | |
480 | 483 | | |
481 | 484 | | |
482 | 485 | | |
| |||
0 commit comments