Commit 72dc0df
authored
fix: update request method of HttpStorageRpc to properly configure offset on requests (#1434)
* fix: update request method of HttpStorageRpc to properly configure offset on requests
When invoking downloadTo(..., OutputStream) if a retry was attempted the proper byte
offset was not being sent in the retried request. Update logic of HttpStorageRpc.read
to manually set the range header rather than trying to rely on MediaDownloader to do
it along with not automatically decompressing the byte stream.
Update ITRetryConformanceTest to run Scenario 8 test cases, which cover resuming a
download which could have caught this error sooner.
Update StorageException.translate(IOException) to classify `IOException: Premature EOF`
as the existing retryable reason `connectionClosedPrematurely`. Add case to
DefaultRetryHandlingBehaviorTest to ensure conformance to this categorization.
Break downloadTo integration test out into their own class, and separate
the multiple scenarios being tested in the same method.
Related to #14251 parent eac03a8 commit 72dc0df
File tree
8 files changed
+199
-72
lines changed- google-cloud-storage/src
- main/java/com/google/cloud/storage
- spi/v1
- test/java/com/google/cloud/storage
- conformance/retry
- it
8 files changed
+199
-72
lines changedLines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
286 | | - | |
| 287 | + | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| |||
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
753 | | - | |
754 | | - | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
755 | 760 | | |
756 | | - | |
| 761 | + | |
757 | 762 | | |
758 | 763 | | |
759 | 764 | | |
| |||
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
298 | 301 | | |
299 | 302 | | |
300 | 303 | | |
301 | | - | |
| 304 | + | |
302 | 305 | | |
303 | 306 | | |
304 | 307 | | |
| |||
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
325 | 331 | | |
326 | 332 | | |
327 | 333 | | |
| |||
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
| 409 | + | |
403 | 410 | | |
404 | 411 | | |
405 | 412 | | |
| |||
919 | 926 | | |
920 | 927 | | |
921 | 928 | | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
922 | 951 | | |
923 | 952 | | |
924 | 953 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
Lines changed: 27 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
111 | 118 | | |
112 | 119 | | |
113 | 120 | | |
| |||
1079 | 1086 | | |
1080 | 1087 | | |
1081 | 1088 | | |
1082 | | - | |
| 1089 | + | |
| 1090 | + | |
1083 | 1091 | | |
1084 | 1092 | | |
1085 | 1093 | | |
| |||
1088 | 1096 | | |
1089 | 1097 | | |
1090 | 1098 | | |
1091 | | - | |
| 1099 | + | |
| 1100 | + | |
1092 | 1101 | | |
1093 | 1102 | | |
1094 | 1103 | | |
1095 | 1104 | | |
1096 | 1105 | | |
1097 | 1106 | | |
| 1107 | + | |
1098 | 1108 | | |
1099 | 1109 | | |
1100 | 1110 | | |
| |||
1108 | 1118 | | |
1109 | 1119 | | |
1110 | 1120 | | |
| 1121 | + | |
1111 | 1122 | | |
1112 | 1123 | | |
1113 | 1124 | | |
| |||
1196 | 1207 | | |
1197 | 1208 | | |
1198 | 1209 | | |
1199 | | - | |
| 1210 | + | |
| 1211 | + | |
1200 | 1212 | | |
1201 | 1213 | | |
1202 | 1214 | | |
| |||
1297 | 1309 | | |
1298 | 1310 | | |
1299 | 1311 | | |
| 1312 | + | |
1300 | 1313 | | |
1301 | 1314 | | |
1302 | 1315 | | |
1303 | 1316 | | |
| 1317 | + | |
1304 | 1318 | | |
1305 | 1319 | | |
1306 | 1320 | | |
| |||
1311 | 1325 | | |
1312 | 1326 | | |
1313 | 1327 | | |
1314 | | - | |
| 1328 | + | |
| 1329 | + | |
1315 | 1330 | | |
1316 | 1331 | | |
1317 | 1332 | | |
| |||
1321 | 1336 | | |
1322 | 1337 | | |
1323 | 1338 | | |
1324 | | - | |
| 1339 | + | |
| 1340 | + | |
1325 | 1341 | | |
1326 | 1342 | | |
1327 | 1343 | | |
| |||
1336 | 1352 | | |
1337 | 1353 | | |
1338 | 1354 | | |
1339 | | - | |
| 1355 | + | |
| 1356 | + | |
1340 | 1357 | | |
1341 | 1358 | | |
1342 | 1359 | | |
| |||
1932 | 1949 | | |
1933 | 1950 | | |
1934 | 1951 | | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
1935 | 1956 | | |
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | | - | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
| |||
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
129 | 162 | | |
130 | 163 | | |
131 | 164 | | |
| |||
153 | 186 | | |
154 | 187 | | |
155 | 188 | | |
156 | | - | |
| 189 | + | |
157 | 190 | | |
158 | 191 | | |
159 | 192 | | |
| |||
0 commit comments