Commit 99e3c06
authored
retry: only buffer request bodies when retries are enabled (#1020)
PR #1017 added support for retries on requests with bodies. This
requires buffering the body data so that it can be sent as part of a
retry request.
In #1017, all requests in the profile HTTP route stack have their bodies
wrapped in a `ReplayBody` type that buffers the request data. Although
the buffering strategy is lazy (the request can be sent before the
client finishes sending the body, so we don't introduce the latency of
waiting to buffer the entire body) and fairly lightweight (the buffered
body data is not copied an additional time, and is cloned only by
increasing the reference count on the buffer it was read into from the
wire), there is still some additional overhead that could be avoided
when retries are not configured on a route.
This branch updates the `Retry` service so that buffering is only added
on routes which have a retry policy. If there is no retry policy, we
avoid wrapping the request's body in a `ReplayBody`.
The `retry` crate is now called `http-retry`.1 parent d17b239 commit 99e3c06
File tree
9 files changed
+84
-63
lines changed- linkerd
- app
- core
- src
- inbound/fuzz
- outbound
- http-retry
- src
9 files changed
+84
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
| |||
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
678 | | - | |
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
| 784 | + | |
784 | 785 | | |
785 | 786 | | |
786 | | - | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
998 | 1018 | | |
999 | 1019 | | |
1000 | 1020 | | |
| |||
1258 | 1278 | | |
1259 | 1279 | | |
1260 | 1280 | | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | 1283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
| 56 | + | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
| 72 | + | |
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
593 | 594 | | |
594 | 595 | | |
595 | 596 | | |
| |||
605 | 606 | | |
606 | 607 | | |
607 | 608 | | |
608 | | - | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
863 | 880 | | |
864 | 881 | | |
865 | 882 | | |
| |||
1116 | 1133 | | |
1117 | 1134 | | |
1118 | 1135 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | 1136 | | |
1136 | 1137 | | |
1137 | 1138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | | - | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
Lines changed: 34 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | | - | |
49 | | - | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
| |||
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
96 | | - | |
| 109 | + | |
97 | 110 | | |
98 | | - | |
99 | | - | |
| 111 | + | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
106 | | - | |
| 122 | + | |
107 | 123 | | |
108 | | - | |
| 124 | + | |
109 | 125 | | |
110 | 126 | | |
111 | 127 | | |
112 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
113 | 131 | | |
114 | | - | |
| 132 | + | |
115 | 133 | | |
116 | 134 | | |
117 | | - | |
| 135 | + | |
118 | 136 | | |
119 | 137 | | |
120 | 138 | | |
121 | | - | |
| 139 | + | |
122 | 140 | | |
123 | | - | |
124 | | - | |
| 141 | + | |
| 142 | + | |
125 | 143 | | |
126 | 144 | | |
127 | 145 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
| 757 | + | |
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| |||
0 commit comments