Commit 93e8ed4
authored
fix: update BlobReadChannelV2 handling to correctly restart for decompressed object (#1867)
* fix: update BlobReadChannelV2 handling to correctly restart for decompressed object
When downloading bytes from gcs and decompressing them, a restart of the stream needs to pickup from the offset within the compressed bytes not the decompressed bytes.
Prior to this change http-client was automatically applying gzip decompression to the stream it returns to us thereby causing our tracking to be off.
This change updates our interaction with http client to always request the raw bytes without any transform applied to them, we then at a higher level can handle whether gzip decompression needs to be plumbed in.
Fix up a couple channel closed state subtleties when buffering is used with decompression.
Add a new test leveraging the testbench which forces a broken stream on some compressed object bytes. _NOTE_ This test depends on the next release of testbench and will be failing until we get that release.
* deps(test): update testbench to v0.33.01 parent 2b94567 commit 93e8ed4
File tree
10 files changed
+150
-42
lines changed- google-cloud-storage/src
- main/java/com/google/cloud/storage
- test/java/com/google/cloud/storage/it
- runner/registry
10 files changed
+150
-42
lines changedLines changed: 21 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 87 | + | |
89 | 88 | | |
90 | 89 | | |
91 | | - | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
| |||
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
117 | 114 | | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
121 | | - | |
122 | 118 | | |
123 | 119 | | |
124 | 120 | | |
| |||
148 | 144 | | |
149 | 145 | | |
150 | 146 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 147 | | |
155 | | - | |
| 148 | + | |
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
| |||
215 | 208 | | |
216 | 209 | | |
217 | 210 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 211 | + | |
222 | 212 | | |
223 | 213 | | |
224 | 214 | | |
| |||
262 | 252 | | |
263 | 253 | | |
264 | 254 | | |
265 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
266 | 258 | | |
267 | 259 | | |
268 | 260 | | |
| |||
288 | 280 | | |
289 | 281 | | |
290 | 282 | | |
291 | | - | |
| 283 | + | |
292 | 284 | | |
293 | 285 | | |
294 | 286 | | |
| |||
303 | 295 | | |
304 | 296 | | |
305 | 297 | | |
306 | | - | |
307 | | - | |
308 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
309 | 301 | | |
310 | 302 | | |
311 | 303 | | |
312 | 304 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
317 | 311 | | |
318 | 312 | | |
| 313 | + | |
319 | 314 | | |
320 | 315 | | |
321 | 316 | | |
322 | 317 | | |
| 318 | + | |
323 | 319 | | |
324 | 320 | | |
325 | 321 | | |
326 | 322 | | |
| 323 | + | |
327 | 324 | | |
328 | 325 | | |
329 | 326 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | | - | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | | - | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | | - | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | | - | |
| 40 | + | |
36 | 41 | | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | | - | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | | - | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
80 | | - | |
81 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
82 | 103 | | |
83 | 104 | | |
84 | 105 | | |
85 | 106 | | |
86 | 107 | | |
| 108 | + | |
| 109 | + | |
87 | 110 | | |
88 | 111 | | |
89 | 112 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| |||
0 commit comments