Commit 4932a44
committed
Widen 2026 cancel silence to every request on a modern-locked connection
The silence fact attached only after classification succeeded, so a
request rejected before classification (envelope-less, malformed envelope)
on a modern-locked connection could still answer after a peer cancel: the
reject runs on a task spawned after the read loop may have already
consumed an adjacent cancel. Unreachable under asyncio's FIFO scheduling -
the reject's answer write always starts before the cancel is consumed,
which is the legitimate already-answering case - but reachable under
trio's randomized scheduling and under any future checkpoint on the reject
path, where the frame written would have been the legacy code-0 answer or
a post-cancel rejection error.
Attach the fact at the top of the modern-locked branch instead, rejections
included: a rejection error is a legitimate answer, only the post-cancel
frame must be silent. On a still-unlocked connection the rule stays
classification-scoped (an unclassifiable request has not proven modern
semantics and keeps the legacy answer), initialize has no window at all
(inline dispatch parks the read loop), and a legacy straggler cancelled
after the lock keeps its legacy answer - scope documented at both
attachment sites and on serve_dual_era_loop.
With the locked branch owning the connection-scoped fact, serve_modern now
attaches its two per-request facts only while the era is unlocked: once
locked, the silence fact is already set and the era-lock observer is a
permanent no-op, so post-lock requests skip the partial allocation and the
per-frame observer invocation.1 parent 34d4f74 commit 4932a44
2 files changed
Lines changed: 76 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
630 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
631 | 642 | | |
632 | 643 | | |
633 | 644 | | |
| |||
672 | 683 | | |
673 | 684 | | |
674 | 685 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
680 | 698 | | |
681 | 699 | | |
682 | 700 | | |
| |||
718 | 736 | | |
719 | 737 | | |
720 | 738 | | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
721 | 749 | | |
722 | 750 | | |
723 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2101 | 2101 | | |
2102 | 2102 | | |
2103 | 2103 | | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
2104 | 2145 | | |
2105 | 2146 | | |
2106 | 2147 | | |
| |||
0 commit comments