Commit 64571a4
Ck/cherrypick 15669 (bazelbuild#15788)
* Chunker: Always seek on the uncompressed stream.
The `WriteRequest.write_offset` field has bizarre semantics during compressed uploads as documented in the remote API protos: https://github.com/bazelbuild/remote-apis/blob/3b4b6402103539d66fcdd1a4d945f660742665ca/build/bazel/remote/execution/v2/remote_execution.proto#L241-L248 In particular, the write offset of the first `WriteRequest` refers to the offset in the uncompressed source.
This change ensures we always seek the uncompressed stream to the correct offset when starting an upload call. The old code could fail to resume compressed uploads under some conditions. The `progressiveCompressedUploadShouldWork` test purported to exercise this situation. The test, however, contained the same logic error as the code under test.
Closes bazelbuild#15669.
PiperOrigin-RevId: 455083727
Change-Id: Ie22dacf31f15644c7a83f49776e7a633d8bb4bca
* Updated chunker.java file.
* Update src/test/java/com/google/devtools/build/lib/remote/ByteStreamUploaderTest.java
Co-authored-by: Benjamin Peterson <[email protected]>
* Update src/test/java/com/google/devtools/build/lib/remote/ByteStreamUploaderTest.java
Co-authored-by: Benjamin Peterson <[email protected]>
* Update src/test/java/com/google/devtools/build/lib/remote/ByteStreamUploaderTest.java
Co-authored-by: Benjamin Peterson <[email protected]>
Co-authored-by: Benjamin Peterson <[email protected]>
Co-authored-by: Benjamin Peterson <[email protected]>1 parent 3ea9eb2 commit 64571a4
File tree
2 files changed
+44
-35
lines changed- src
- main/java/com/google/devtools/build/lib/remote
- test/java/com/google/devtools/build/lib/remote
2 files changed
+44
-35
lines changedLines changed: 22 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
151 | 159 | | |
| 160 | + | |
152 | 161 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| |||
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
248 | 259 | | |
249 | 260 | | |
250 | 261 | | |
251 | 262 | | |
| 263 | + | |
| 264 | + | |
252 | 265 | | |
253 | 266 | | |
254 | | - | |
255 | | - | |
| 267 | + | |
| 268 | + | |
256 | 269 | | |
257 | 270 | | |
258 | 271 | | |
259 | 272 | | |
| 273 | + | |
260 | 274 | | |
261 | 275 | | |
262 | 276 | | |
| |||
Lines changed: 22 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
361 | 364 | | |
362 | 365 | | |
363 | 366 | | |
364 | | - | |
| 367 | + | |
365 | 368 | | |
366 | 369 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 370 | + | |
373 | 371 | | |
374 | 372 | | |
375 | | - | |
376 | | - | |
377 | 373 | | |
378 | 374 | | |
379 | 375 | | |
| |||
398 | 394 | | |
399 | 395 | | |
400 | 396 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | 397 | | |
413 | 398 | | |
414 | 399 | | |
415 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
416 | 412 | | |
417 | 413 | | |
418 | 414 | | |
| |||
423 | 419 | | |
424 | 420 | | |
425 | 421 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | 422 | | |
431 | 423 | | |
432 | 424 | | |
| |||
444 | 436 | | |
445 | 437 | | |
446 | 438 | | |
447 | | - | |
| 439 | + | |
448 | 440 | | |
449 | 441 | | |
450 | 442 | | |
| |||
460 | 452 | | |
461 | 453 | | |
462 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
463 | 458 | | |
464 | 459 | | |
465 | 460 | | |
| |||
0 commit comments