Commit fd3eaa6
_http: ensure _HttpProfileData.startResponse is called before finishResponse
Fixes flutter/devtools#8509
From my research into the bug:
> I see indeed that `_HttpProfileData.finishResponse()` is called before `_HttpProfileData.startResponse()`. I think this is just a result of microtask scheduling; when the response has no body, `_incoming.dataDone` completes before `_httpRequest._responseCompleter`.
> Since `startResponse` is responsible for setting `responseInProgress` to `true`, the call to `finishResponse` short circuit returns immediately. We therefore don't finish the response timeline, or log the end time, etc.
The fix here does not rely on microtask organization, which I think would be fragile. Instead, we don't listen to the `dataDone` future
until we've logged the start of the response.
Change-Id: Ib735742b297a261e6566ae8caf9eac0d71fc8fdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415140
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>1 parent a9ea504 commit fd3eaa6
File tree
2 files changed
+91
-14
lines changed- pkg/vm_service/test
- sdk/lib/_http
2 files changed
+91
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
| 251 | + | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
| |||
279 | 285 | | |
280 | 286 | | |
281 | 287 | | |
282 | | - | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
332 | | - | |
| 338 | + | |
333 | 339 | | |
334 | 340 | | |
335 | 341 | | |
| |||
350 | 356 | | |
351 | 357 | | |
352 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| 180 | + | |
178 | 181 | | |
179 | 182 | | |
180 | 183 | | |
| |||
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| 192 | + | |
189 | 193 | | |
190 | | - | |
191 | | - | |
| 194 | + | |
| 195 | + | |
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
242 | 253 | | |
243 | 254 | | |
244 | 255 | | |
| |||
609 | 620 | | |
610 | 621 | | |
611 | 622 | | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | 623 | | |
616 | 624 | | |
617 | 625 | | |
| |||
1482 | 1490 | | |
1483 | 1491 | | |
1484 | 1492 | | |
| 1493 | + | |
| 1494 | + | |
1485 | 1495 | | |
1486 | 1496 | | |
1487 | 1497 | | |
| |||
1522 | 1532 | | |
1523 | 1533 | | |
1524 | 1534 | | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1525 | 1540 | | |
1526 | 1541 | | |
1527 | 1542 | | |
| |||
1554 | 1569 | | |
1555 | 1570 | | |
1556 | 1571 | | |
1557 | | - | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
1558 | 1576 | | |
1559 | 1577 | | |
1560 | 1578 | | |
| |||
2396 | 2414 | | |
2397 | 2415 | | |
2398 | 2416 | | |
2399 | | - | |
| 2417 | + | |
2400 | 2418 | | |
2401 | 2419 | | |
2402 | 2420 | | |
| |||
0 commit comments