Commit 8a56acd
committed
TASK-038-002: Rewrite Http1XCorrelationStage — Strict One-Request-In-Flight
Rewrites Http1XCorrelationStage to enforce strict HTTP/1.x back-pressure per RFC 9112 §9.
Only one request is in-flight at a time; the next request is not pulled until its response
has been delivered on OutResponse.
Changes:
- Http1XCorrelationShape: InReset inlet removed; shape is now 2 inlets + 2 outlets.
- Http1XCorrelationStage.Logic: removed _pending queue, _waiting queue, _pipelineUnlocked
flag, and PreStart(). Replaced with a single _inFlightRequest field.
- Back-pressure contract: InRequest is pulled only when _inFlightRequest == null.
onPush(InRequest) stores the request, emits StreamAcquireItem, then pulls InResponse.
onPush(InResponse) matches the in-flight request, sets _inFlightRequest = null, and
pushes the response — only then does the downstream demand trigger the next InRequest pull.
- Completion: stage completes when both upstreams finish and _inFlightRequest == null,
OR gracefully when InResponse closes while a request is in-flight (no deadlock).
- Http10Engine.cs / Http11Engine.cs: removed the two dead InReset wiring lines
(Source.Empty<NotUsed>() + b.From(resetSrc).To(correlation.InReset)).
- Test suite updated: removed InReset wiring from all test helpers and inline graphs,
removed tests that verified removed behavior (pipelining, InReset reconnect),
updated descriptions to reflect strict serial model. 831/831 stream tests pass.1 parent 1291185 commit 8a56acd
7 files changed
Lines changed: 105 additions & 354 deletions
File tree
- .maggus/features
- src
- TurboHttp.StreamTests
- Concurrency
- RFC9112
- TurboHttp/Streams
- Stages/Routing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
Lines changed: 39 additions & 124 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
| |||
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
111 | | - | |
112 | | - | |
| 109 | + | |
| 110 | + | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
117 | | - | |
118 | | - | |
| 115 | + | |
| 116 | + | |
119 | 117 | | |
120 | | - | |
121 | | - | |
| 118 | + | |
| 119 | + | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
| |||
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
135 | | - | |
| 133 | + | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
164 | 162 | | |
165 | 163 | | |
166 | 164 | | |
167 | | - | |
168 | 165 | | |
169 | 166 | | |
170 | | - | |
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
| |||
180 | 176 | | |
181 | 177 | | |
182 | 178 | | |
183 | | - | |
184 | | - | |
| 179 | + | |
| 180 | + | |
185 | 181 | | |
186 | | - | |
187 | | - | |
188 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
189 | 185 | | |
190 | 186 | | |
191 | 187 | | |
192 | 188 | | |
193 | 189 | | |
194 | 190 | | |
195 | | - | |
| 191 | + | |
196 | 192 | | |
197 | 193 | | |
198 | 194 | | |
| |||
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
206 | | - | |
207 | 202 | | |
208 | 203 | | |
209 | | - | |
210 | 204 | | |
211 | 205 | | |
212 | 206 | | |
| |||
215 | 209 | | |
216 | 210 | | |
217 | 211 | | |
218 | | - | |
219 | | - | |
| 212 | + | |
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
| |||
237 | 230 | | |
238 | 231 | | |
239 | 232 | | |
240 | | - | |
241 | 233 | | |
242 | 234 | | |
243 | | - | |
244 | 235 | | |
245 | 236 | | |
246 | 237 | | |
| |||
278 | 269 | | |
279 | 270 | | |
280 | 271 | | |
281 | | - | |
282 | 272 | | |
283 | 273 | | |
284 | | - | |
285 | 274 | | |
286 | 275 | | |
287 | 276 | | |
| |||
Lines changed: 11 additions & 102 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 24 | | |
31 | 25 | | |
32 | 26 | | |
33 | | - | |
34 | 27 | | |
35 | 28 | | |
36 | 29 | | |
| |||
41 | 34 | | |
42 | 35 | | |
43 | 36 | | |
44 | | - | |
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
48 | | - | |
49 | 40 | | |
50 | 41 | | |
51 | 42 | | |
| |||
59 | 50 | | |
60 | 51 | | |
61 | 52 | | |
62 | | - | |
63 | | - | |
| 53 | + | |
| 54 | + | |
64 | 55 | | |
65 | 56 | | |
66 | | - | |
67 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
68 | 60 | | |
69 | 61 | | |
70 | 62 | | |
71 | 63 | | |
72 | 64 | | |
73 | 65 | | |
74 | | - | |
| 66 | + | |
75 | 67 | | |
76 | 68 | | |
77 | 69 | | |
78 | 70 | | |
79 | 71 | | |
80 | 72 | | |
81 | 73 | | |
82 | | - | |
83 | | - | |
| 74 | + | |
84 | 75 | | |
85 | 76 | | |
86 | 77 | | |
87 | 78 | | |
88 | 79 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 80 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| |||
0 commit comments