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

--incompatible_remote_build_event_upload_respect_no_cache + combined cache (remote + disk cache) causes BES-only uploads to disk cache #14435

Closed
brentleyjones opened this issue Dec 15, 2021 · 4 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug

Comments

@brentleyjones
Copy link
Contributor

brentleyjones commented Dec 15, 2021

Description of the problem / feature request:

When using the new --incompatible_remote_build_event_upload_respect_no_cache flag, along with a combined remote+disk cache, blobs that are only for BES upload are uploaded to the disk cache (in addition to the remote cache). This has a couple negative side effects including:

  • Using disk space for blobs that will never be referenced locally
  • Performing expensive FindMissingBlobs calls on the disk cache
  • Causing --bes_upload_mode=fully_async to block for disk IO

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Perform a build with the following flags, two times:

build --bes_upload_mode=fully_async
build --remote_cache=grpcs://remote.buildbuddy.io
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://remote.buildbuddy.io
build --disk_cache=/tmp/bazel_disk_cache
build --incompatible_remote_build_event_upload_respect_no_cache
build --noremote_upload_local_results

If the build has lots of things that will be BES-only uploads (one of my examples was 20k+ blobs), the second build will stall at the end as it performs disk cache related operations.

What operating system are you running Bazel on?

macOS 12.0.1

What's the output of bazel info release?

release 5.0.0rc3

Have you found anything relevant by searching the web?

#14338

@brentleyjones
Copy link
Contributor Author

cc: @coeuvre

Also, since this is for a new flag that is shipping with 5.0, it might be good to get into another RC (if there is one).

@coeuvre coeuvre self-assigned this Dec 15, 2021
@coeuvre coeuvre added P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug labels Dec 15, 2021
@coeuvre coeuvre added this to the Bazel 5.0 Release Blockers milestone Dec 15, 2021
@brentleyjones
Copy link
Contributor Author

The biggest issue for us (out of the negative side effects listed) is the potentially very expensive FindMissingBlobs on the disk cache for all BES referenced blobs.

@coeuvre
Copy link
Member

coeuvre commented Dec 15, 2021

Do we still have the stall at the end of the build if --incompatible_remote_build_event_upload_respect_no_cache is not set?

@brentleyjones
Copy link
Contributor Author

brentleyjones commented Dec 15, 2021

Yes, it is just longer, as more blobs are considered. I only related the two, as without --incompatible_remote_build_event_upload_respect_no_cache, we would set --experimental_build_event_upload_strategy=local instead, which would get around this issue (as nothing BES related would be uploaded).

coeuvre added a commit to coeuvre/bazel that referenced this issue Dec 23, 2021
Wyverald pushed a commit that referenced this issue Dec 23, 2021
* Remote: Don't upload BES referenced blobs to disk cache.

Fixes #14435.

Closes #14451.

PiperOrigin-RevId: 417629899

* Remote: Make `--incompatible_remote_build_event_upload_respect_no_cache` working with alias.

Fixes #14456.

Closes #14461.

PiperOrigin-RevId: 417637635

* Remote: Make --incompatible_remote_build_event_upload_respect_no_cache working with --incompatible_remote_results_ignore_disk.

Fixes #14463.

Closes #14468.

PiperOrigin-RevId: 417984062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants