Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunker: Always seek on the uncompressed stream. #15720

Closed
wants to merge 2 commits into from
Closed

Chunker: Always seek on the uncompressed stream. #15720

wants to merge 2 commits into from

Conversation

ckolli5
Copy link

@ckolli5 ckolli5 commented Jun 22, 2022

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 #15669.

PiperOrigin-RevId: 455083727
Change-Id: Ie22dacf31f15644c7a83f49776e7a633d8bb4bca

benjaminp and others added 2 commits June 21, 2022 21:37
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 #15669.

PiperOrigin-RevId: 455083727
Change-Id: Ie22dacf31f15644c7a83f49776e7a633d8bb4bca
@brentleyjones
Copy link
Contributor

This probably requires the refactor commit. @benjaminp can you help @ckolli5 get the right commits for this cherry-pick?

checkState(data == null);
checkState(offset == 0);
checkState(chunkCache == null);
try {
var src = dataSupplier.get();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably going to have to write InputStream src = dataSupplier.get(), since Bazel 5 requires the Java 8 language level.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @benjaminp, I tried that but still the builds are failing. Here is the PR with the suggested changes. Could you please help us in cherry picking these changes. Thanks!

@ckolli5 ckolli5 mentioned this pull request Jul 1, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants