Commit bc37675
http2: limit number of PINGs bundled with RST_STREAMs
gRPC has an unfortunate behavior of stictly rate limiting
the number of PING frames that it will receive. The default is
two PING frames every two hours when no requests are in flight;
two PING frames every five minutes when a request is in flight;
and the limit resets every time the gRPC endpoint sends a
HEADERS or DATA frame.
When sending a RST_STREAM frame, the Transport can bundle a PING
frame with it to confirm the server is responding. When canceling
several requests in succession, this can result in hitting the
gRPC ping limit.
Work around this gRPC behavior by sending at most one bundled
PING per HEADERS or DATA frame received. We already limit
ourselves to one PING in flight at a time; now, when we receive
a PING response, disable sending additional bundled PINGs
until we read a HEADERS/DATA frame.
This does not affect keep-alive pings.
Fixes golang/go#70575.
Change-Id: I7c4003039bd2dc52106b2806ca31eeeee37b7e09
Reviewed-on: https://go-review.googlesource.com/c/net/+/632995
Reviewed-by: Jonathan Amsterdam <[email protected]>
Auto-Submit: Damien Neil <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>1 parent e9cd716 commit bc37675
2 files changed
+108
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
402 | 412 | | |
403 | 413 | | |
404 | 414 | | |
| |||
1738 | 1748 | | |
1739 | 1749 | | |
1740 | 1750 | | |
1741 | | - | |
1742 | | - | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
1743 | 1758 | | |
1744 | | - | |
1745 | 1759 | | |
1746 | 1760 | | |
1747 | 1761 | | |
| |||
2489 | 2503 | | |
2490 | 2504 | | |
2491 | 2505 | | |
2492 | | - | |
| 2506 | + | |
2493 | 2507 | | |
2494 | 2508 | | |
2495 | 2509 | | |
| |||
2544 | 2558 | | |
2545 | 2559 | | |
2546 | 2560 | | |
2547 | | - | |
| 2561 | + | |
2548 | 2562 | | |
2549 | 2563 | | |
2550 | 2564 | | |
| |||
2873 | 2887 | | |
2874 | 2888 | | |
2875 | 2889 | | |
2876 | | - | |
| 2890 | + | |
2877 | 2891 | | |
2878 | 2892 | | |
2879 | 2893 | | |
| |||
3008 | 3022 | | |
3009 | 3023 | | |
3010 | 3024 | | |
3011 | | - | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
3012 | 3034 | | |
3013 | 3035 | | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
3014 | 3041 | | |
3015 | 3042 | | |
3016 | 3043 | | |
| |||
3145 | 3172 | | |
3146 | 3173 | | |
3147 | 3174 | | |
3148 | | - | |
| 3175 | + | |
3149 | 3176 | | |
3150 | 3177 | | |
3151 | 3178 | | |
| |||
3174 | 3201 | | |
3175 | 3202 | | |
3176 | 3203 | | |
3177 | | - | |
| 3204 | + | |
3178 | 3205 | | |
3179 | 3206 | | |
3180 | 3207 | | |
| |||
3252 | 3279 | | |
3253 | 3280 | | |
3254 | 3281 | | |
| 3282 | + | |
3255 | 3283 | | |
3256 | 3284 | | |
3257 | 3285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5562 | 5562 | | |
5563 | 5563 | | |
5564 | 5564 | | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
5565 | 5569 | | |
5566 | 5570 | | |
5567 | 5571 | | |
5568 | 5572 | | |
5569 | 5573 | | |
5570 | 5574 | | |
5571 | 5575 | | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
| 5580 | + | |
| 5581 | + | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
| 5585 | + | |
| 5586 | + | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
| 5593 | + | |
| 5594 | + | |
| 5595 | + | |
| 5596 | + | |
| 5597 | + | |
| 5598 | + | |
| 5599 | + | |
| 5600 | + | |
| 5601 | + | |
| 5602 | + | |
| 5603 | + | |
| 5604 | + | |
| 5605 | + | |
| 5606 | + | |
| 5607 | + | |
| 5608 | + | |
| 5609 | + | |
| 5610 | + | |
| 5611 | + | |
| 5612 | + | |
| 5613 | + | |
| 5614 | + | |
| 5615 | + | |
| 5616 | + | |
| 5617 | + | |
| 5618 | + | |
| 5619 | + | |
| 5620 | + | |
| 5621 | + | |
| 5622 | + | |
| 5623 | + | |
| 5624 | + | |
| 5625 | + | |
| 5626 | + | |
| 5627 | + | |
| 5628 | + | |
| 5629 | + | |
| 5630 | + | |
| 5631 | + | |
| 5632 | + | |
| 5633 | + | |
| 5634 | + | |
| 5635 | + | |
| 5636 | + | |
| 5637 | + | |
| 5638 | + | |
| 5639 | + | |
| 5640 | + | |
| 5641 | + | |
| 5642 | + | |
5572 | 5643 | | |
5573 | 5644 | | |
5574 | 5645 | | |
| |||
0 commit comments