Commit e592c32
http2: fix several timeout related issues
* correctly reset write timers: currently reset timers on
both session & stream when write starts and when it ends.
* prevent large writes from timing out: when writing a large
chunk of data in http2, once the data is handed off to C++,
the JS session & stream lose all track of the write and will
timeout if the write doesn't complete within the timeout window
Fix this issue by tracking whether a write request is ongoing and
also tracking how many chunks have been sent since the most recent
write started. (Since each write call resets the timer.)
PR-URL: #16525
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 1b08ae8 commit e592c32Copy full SHA for e592c32
File tree
Expand file treeCollapse file tree
6 files changed
+274
-6
lines changedOpen diff view settings
Filter options
- lib/internal/http2
- src
- test/sequential
Expand file treeCollapse file tree
6 files changed
+274
-6
lines changedOpen diff view settings
Collapse file
+72-6Lines changed: 72 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
746 | 746 | |
747 | 747 | |
748 | 748 | |
749 | | - |
| 749 | + |
| 750 | + |
750 | 751 | |
751 | 752 | |
752 | 753 | |
| ||
1080 | 1081 | |
1081 | 1082 | |
1082 | 1083 | |
| 1084 | + |
| 1085 | + |
| 1086 | + |
| 1087 | + |
| 1088 | + |
| 1089 | + |
| 1090 | + |
| 1091 | + |
| 1092 | + |
| 1093 | + |
| 1094 | + |
| 1095 | + |
| 1096 | + |
| 1097 | + |
| 1098 | + |
| 1099 | + |
1083 | 1100 | |
1084 | 1101 | |
1085 | 1102 | |
| ||
1199 | 1216 | |
1200 | 1217 | |
1201 | 1218 | |
| 1219 | + |
| 1220 | + |
| 1221 | + |
| 1222 | + |
| 1223 | + |
| 1224 | + |
| 1225 | + |
1202 | 1226 | |
1203 | | - |
| 1227 | + |
| 1228 | + |
| 1229 | + |
| 1230 | + |
| 1231 | + |
| 1232 | + |
| 1233 | + |
| 1234 | + |
| 1235 | + |
| 1236 | + |
| 1237 | + |
| 1238 | + |
| 1239 | + |
1204 | 1240 | |
1205 | 1241 | |
1206 | 1242 | |
| ||
1312 | 1348 | |
1313 | 1349 | |
1314 | 1350 | |
1315 | | - |
| 1351 | + |
| 1352 | + |
1316 | 1353 | |
1317 | 1354 | |
1318 | 1355 | |
| ||
1359 | 1396 | |
1360 | 1397 | |
1361 | 1398 | |
| 1399 | + |
| 1400 | + |
| 1401 | + |
| 1402 | + |
| 1403 | + |
| 1404 | + |
| 1405 | + |
| 1406 | + |
| 1407 | + |
| 1408 | + |
| 1409 | + |
| 1410 | + |
| 1411 | + |
| 1412 | + |
| 1413 | + |
| 1414 | + |
| 1415 | + |
1362 | 1416 | |
1363 | 1417 | |
1364 | 1418 | |
| ||
1396 | 1450 | |
1397 | 1451 | |
1398 | 1452 | |
1399 | | - |
1400 | 1453 | |
1401 | 1454 | |
1402 | 1455 | |
| 1456 | + |
| 1457 | + |
1403 | 1458 | |
1404 | 1459 | |
1405 | 1460 | |
| ||
1410 | 1465 | |
1411 | 1466 | |
1412 | 1467 | |
1413 | | - |
| 1468 | + |
1414 | 1469 | |
1415 | 1470 | |
1416 | 1471 | |
1417 | 1472 | |
1418 | 1473 | |
1419 | 1474 | |
1420 | 1475 | |
1421 | | - |
1422 | 1476 | |
1423 | 1477 | |
1424 | 1478 | |
| 1479 | + |
| 1480 | + |
1425 | 1481 | |
1426 | 1482 | |
1427 | 1483 | |
| ||
1438 | 1494 | |
1439 | 1495 | |
1440 | 1496 | |
| 1497 | + |
1441 | 1498 | |
1442 | 1499 | |
1443 | 1500 | |
| ||
1531 | 1588 | |
1532 | 1589 | |
1533 | 1590 | |
| 1591 | + |
| 1592 | + |
| 1593 | + |
| 1594 | + |
1534 | 1595 | |
1535 | 1596 | |
1536 | 1597 | |
| ||
1625 | 1686 | |
1626 | 1687 | |
1627 | 1688 | |
| 1689 | + |
1628 | 1690 | |
| 1691 | + |
| 1692 | + |
| 1693 | + |
| 1694 | + |
1629 | 1695 | |
1630 | 1696 | |
1631 | 1697 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
111 | 111 | |
112 | 112 | |
113 | 113 | |
| 114 | + |
114 | 115 | |
115 | 116 | |
116 | 117 | |
|
Collapse file
+24Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
603 | 603 | |
604 | 604 | |
605 | 605 | |
| 606 | + |
| 607 | + |
606 | 608 | |
607 | 609 | |
608 | 610 | |
| ||
757 | 759 | |
758 | 760 | |
759 | 761 | |
| 762 | + |
| 763 | + |
| 764 | + |
| 765 | + |
| 766 | + |
| 767 | + |
| 768 | + |
| 769 | + |
| 770 | + |
| 771 | + |
| 772 | + |
| 773 | + |
| 774 | + |
| 775 | + |
| 776 | + |
| 777 | + |
| 778 | + |
760 | 779 | |
761 | 780 | |
762 | 781 | |
| ||
811 | 830 | |
812 | 831 | |
813 | 832 | |
| 833 | + |
| 834 | + |
814 | 835 | |
815 | 836 | |
816 | 837 | |
| ||
846 | 867 | |
847 | 868 | |
848 | 869 | |
| 870 | + |
849 | 871 | |
850 | 872 | |
851 | 873 | |
| ||
1255 | 1277 | |
1256 | 1278 | |
1257 | 1279 | |
| 1280 | + |
| 1281 | + |
1258 | 1282 | |
1259 | 1283 | |
1260 | 1284 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
475 | 475 | |
476 | 476 | |
477 | 477 | |
| 478 | + |
478 | 479 | |
479 | 480 | |
480 | 481 | |
| ||
493 | 494 | |
494 | 495 | |
495 | 496 | |
| 497 | + |
| 498 | + |
| 499 | + |
496 | 500 | |
497 | 501 | |
498 | 502 | |
|
Collapse file
test/sequential/test-http2-timeout-large-write-file.js
Copy file name to clipboard+89Lines changed: 89 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
0 commit comments