Commit 59513ce
authored
fix: adjust expiring reset stream limits (#858)
h2 has mechanisms to remember a local reset stream for some time afterward, to support what it says in RFC 9113 SS 5.4.2:
> A RST_STREAM is the last frame that an endpoint can send on a stream. The peer that sends the RST_STREAM frame MUST be prepared to receive any frames that were sent or enqueued for sending by the remote peer. These frames can be ignored, except where they modify connection state (such as the state maintained for field section compression (Section 4.3) or flow control).
>
> Normally, an endpoint SHOULD NOT send more than one RST_STREAM frame for any stream. However, an endpoint MAY send additional RST_STREAM frames if it receives frames on a closed stream after more than a round-trip time. This behavior is permitted to deal with misbehaving implementations.
We don't want to remember the streams for forever, that would cause memory to grow. Nor do we want to accept frames on those streams without limit, since that would waste resources. Thus, we limit how much we remember, but stream count and duration.
This changes the defaults to be something perhaps a little more reasonable:
- 50 streams, a conservative amount of half of the recommending minimum concurrent streams any remote SHOULD support.
- 1 second, since the RFC only suggests about 1 RTT. We don't keep track of RTT, but even p99 RTT is around 250ms, maybe 500ms.
One possibility is having different values for server and client, since servers are usually more interested in constraining resources, but at the same time, many servers also contain clients.
cc #8561 parent c85d1e8 commit 59513ce
4 files changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
926 | | - | |
| 926 | + | |
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
971 | | - | |
| 971 | + | |
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
916 | | - | |
917 | 915 | | |
918 | 916 | | |
| 917 | + | |
919 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
920 | 924 | | |
921 | 925 | | |
922 | 926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
871 | | - | |
| 871 | + | |
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
| |||
0 commit comments