Commit bff14c5
committed
http2: don't PING a responsive server when resetting a stream
When sending a RST_STREAM for a canceled request, we sometimes send
a PING frame along with the reset to confirm that the server is responsive
and has received the reset.
Sending too many PINGs trips denial-of-service detection on some servers,
causing them to close a connection with an ENHANCE_YOUR_CALM error.
Do not send a PING frame along with an RST_STREAM if the connection
has displayed signs of life since the canceled request began.
Specifically, if we've received any stream-related frames since the
request was sent, assume the server is responsive and do not send a PING.
We still send a PING if a request is canceled and no stream-related
frames have been received from the server since the request was first
sent.
For golang/go#76296
Change-Id: I1be3532febf9ac99d65e9cd35346c02306db5f9d
Reviewed-on: https://go-review.googlesource.com/c/net/+/720300
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>1 parent 88a6421 commit bff14c5
3 files changed
+72
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
298 | 300 | | |
299 | | - | |
300 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
301 | 304 | | |
302 | 305 | | |
303 | 306 | | |
| |||
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
| 373 | + | |
370 | 374 | | |
371 | 375 | | |
372 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
| |||
1654 | 1661 | | |
1655 | 1662 | | |
1656 | 1663 | | |
| 1664 | + | |
| 1665 | + | |
1657 | 1666 | | |
1658 | 1667 | | |
1659 | 1668 | | |
| |||
1685 | 1694 | | |
1686 | 1695 | | |
1687 | 1696 | | |
1688 | | - | |
1689 | | - | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
1690 | 1701 | | |
1691 | 1702 | | |
1692 | 1703 | | |
| |||
1697 | 1708 | | |
1698 | 1709 | | |
1699 | 1710 | | |
1700 | | - | |
| 1711 | + | |
1701 | 1712 | | |
1702 | 1713 | | |
1703 | 1714 | | |
| |||
2784 | 2795 | | |
2785 | 2796 | | |
2786 | 2797 | | |
| 2798 | + | |
2787 | 2799 | | |
2788 | 2800 | | |
2789 | 2801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2563 | 2563 | | |
2564 | 2564 | | |
2565 | 2565 | | |
2566 | | - | |
2567 | | - | |
2568 | | - | |
2569 | 2566 | | |
2570 | 2567 | | |
2571 | 2568 | | |
| |||
5567 | 5564 | | |
5568 | 5565 | | |
5569 | 5566 | | |
| 5567 | + | |
| 5568 | + | |
5570 | 5569 | | |
5571 | 5570 | | |
5572 | 5571 | | |
| |||
5578 | 5577 | | |
5579 | 5578 | | |
5580 | 5579 | | |
5581 | | - | |
| 5580 | + | |
5582 | 5581 | | |
5583 | 5582 | | |
5584 | 5583 | | |
5585 | 5584 | | |
5586 | 5585 | | |
5587 | 5586 | | |
5588 | 5587 | | |
5589 | | - | |
5590 | | - | |
5591 | | - | |
5592 | | - | |
5593 | | - | |
5594 | | - | |
5595 | | - | |
5596 | | - | |
5597 | 5588 | | |
5598 | 5589 | | |
5599 | 5590 | | |
5600 | 5591 | | |
5601 | | - | |
| 5592 | + | |
5602 | 5593 | | |
5603 | 5594 | | |
5604 | 5595 | | |
5605 | 5596 | | |
5606 | 5597 | | |
5607 | | - | |
| 5598 | + | |
5608 | 5599 | | |
5609 | 5600 | | |
5610 | 5601 | | |
| |||
5613 | 5604 | | |
5614 | 5605 | | |
5615 | 5606 | | |
| 5607 | + | |
5616 | 5608 | | |
5617 | | - | |
5618 | | - | |
5619 | | - | |
| 5609 | + | |
| 5610 | + | |
| 5611 | + | |
| 5612 | + | |
| 5613 | + | |
| 5614 | + | |
| 5615 | + | |
| 5616 | + | |
| 5617 | + | |
| 5618 | + | |
| 5619 | + | |
5620 | 5620 | | |
5621 | | - | |
5622 | | - | |
5623 | | - | |
5624 | | - | |
| 5621 | + | |
| 5622 | + | |
| 5623 | + | |
| 5624 | + | |
| 5625 | + | |
| 5626 | + | |
| 5627 | + | |
| 5628 | + | |
| 5629 | + | |
| 5630 | + | |
| 5631 | + | |
| 5632 | + | |
| 5633 | + | |
| 5634 | + | |
| 5635 | + | |
| 5636 | + | |
| 5637 | + | |
| 5638 | + | |
| 5639 | + | |
| 5640 | + | |
| 5641 | + | |
5625 | 5642 | | |
| 5643 | + | |
| 5644 | + | |
| 5645 | + | |
| 5646 | + | |
| 5647 | + | |
| 5648 | + | |
| 5649 | + | |
| 5650 | + | |
| 5651 | + | |
| 5652 | + | |
| 5653 | + | |
| 5654 | + | |
| 5655 | + | |
5626 | 5656 | | |
5627 | 5657 | | |
5628 | 5658 | | |
| |||
0 commit comments