-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat: add option to exit early if analysis cache is discarded #16805
feat: add option to exit early if analysis cache is discarded #16805
Conversation
f59a234
to
a5c8298
Compare
src/main/java/com/google/devtools/build/lib/analysis/AnalysisOptions.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
Outdated
Show resolved
Hide resolved
👋 What is the status of this PR? Context: I have a job that takes average 5min to run. The build was inadvertently discarding the analysis cache. When fixed, the average job time went down to 2min 😮 |
We need to integrate feedback on exactly how the information is communicated. See #16805 (comment). I'm not sure where this fits on @mattem 's current workload. I'll see if I can clarify the linked comment a bit more clearly, since it leaves room for interpretation. |
For bazelbuild#16805. PiperOrigin-RevId: 516684564 Change-Id: I23024704ae2b35c1a5f9cd31b8839886b1bb8dc3
See my just-posted inline comment (https://github.com/bazelbuild/bazel/pull/16805/files#r1136437606). |
Sorry, this is stalled on me. I'm juggling quite a bit currently, but I'll see if I can work on this later this week. @gregestren Those comments above make sense to me on a quick glance. Did you want the addition to the |
I support the |
a5c8298
to
8313dd0
Compare
8313dd0
to
bb30682
Compare
Just back from vacation last week. Looking forward to reviewing the updates... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me. Just a few more small-scale comments.
src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewForTesting.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/AnalysisOptions.java
Outdated
Show resolved
Hide resolved
Since we're getting close to submission, I want to signal boost @mattem 's old comment about flag naming. The current name is |
I like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pulling this all the way through, @mattem .
@bazel-io flag |
@bazel-io fork 6.4.0 |
@gregestren @mattem
cc: @bazelbuild/triage |
I thought we had a similar challenge with the original merge somewhere? If so, it should be straightforward to resolve. I'll get to this as soon as I can. What's the deadline for 6.4.0? |
|
Hi, @gregestren @brentleyjones. I just wanted to check up on this. Are we still pushing this to be part of 6.4.0? The expected first release candidate date is next Monday (9/18/2023), just FYI. |
Yes. I was away for two weeks, just back today. I'll try to prep up a new patch... |
Adds `--allow_analysis_cache_discard` option that allows the build to exit early if the analysis cache would have been discarded. The flag name is of course open to bikeshedding etc. fixes bazelbuild#16804 Closes bazelbuild#16805. PiperOrigin-RevId: 552575951 Change-Id: Ia336eb3a5b7d7e41665fd0e0adf3edc03ed50f18
Adds `--allow_analysis_cache_discard` option that allows the build to exit early if the analysis cache would have been discarded. The flag name is of course open to bikeshedding etc. fixes bazelbuild#16804 Closes bazelbuild#16805. PiperOrigin-RevId: 552575951 Change-Id: Ia336eb3a5b7d7e41665fd0e0adf3edc03ed50f18
…#19503) Forked from #16805. Manually merged conflicts observed at #16805 (comment). Fixes #19162. --------- Co-authored-by: Matt Mackay <mattem@gmail.com>
…#19503) Forked from #16805. Manually merged conflicts observed at #16805 (comment). Fixes #19162. --------- Co-authored-by: Matt Mackay <mattem@gmail.com>
The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc. |
These proto files are taken from commit bazelbuild/bazel@76117b4 Highlight: - Inclusion of ActionCacheStatistics in build_event_stream bazelbuild/bazel#17615 - Explicit Execution phase timing (in prepare for Skymeld) bazelbuild/bazel@be63eee - If `--noallow_analysis_cache_discard` is set, BuildFinished may contains FailureDetails -> CONFIGURATION_DISCARDED_ANALYSIS_CACHE. bazelbuild/bazel#16805 - ExecRequest event is included for `bazel run` bazelbuild/bazel@9a047de - TestProgress event is included for TestRunner action bazelbuild/bazel@d8b8ab0 - ActionExecuted now includes start/end time and strategy information bazelbuild/bazel@2ddacab
Mention the new flag from bazelbuild#16805 that can help prevent analysis cache discards
Many thanks for this really helpful feature! (Also on behalf of many satisfied users.) I was wondering if it would make sense to extend this logic to "server restared because startup options changed". Restarting the server of course also invalidates, so it wouldn't be stretch to say that the flag should also prevent that, would it? |
Adds
--fail_on_analysis_cache_discard
option that allows the build to exit early if the analysis cache would have been discarded.The flag name is of course open to bikeshedding etc.
fixes #16804