[WIP] Async tree deletion on first build#15
Open
ahirreddy wants to merge 1 commit intodatabricks-bazel-6.3.1from
Open
[WIP] Async tree deletion on first build#15ahirreddy wants to merge 1 commit intodatabricks-bazel-6.3.1from
ahirreddy wants to merge 1 commit intodatabricks-bazel-6.3.1from
Conversation
| if (firstBuild && sandboxBase.exists()) { | ||
| cmdEnv.getReporter().handle(Event.info("Deleting stale sandbox base " + sandboxBase)); | ||
| sandboxBase.deleteTree(); | ||
| if (options.asyncFirstBuildDelete && (treeDeleter instanceof AsynchronousTreeDeleter)) { |
There was a problem hiding this comment.
Do we need to check for the treeDeleter to be a AsynchronousTreeDeleter? Seems like the logic below works regardless.
|
|
||
| // Get a random int to use as a unique identifier for this deletion. This should be a | ||
| // positive int. nextInt(foo) returns a value between 0 (inclusive) and foo (exclusive). | ||
| int identifier = new Random().nextInt(Integer.MAX_VALUE); |
There was a problem hiding this comment.
Let's use the current server pid instead, it is guarantee to be unique
| if (firstBuild && sandboxBase.exists()) { | ||
| cmdEnv.getReporter().handle(Event.info("Deleting stale sandbox base " + sandboxBase)); | ||
| sandboxBase.deleteTree(); | ||
| if (options.asyncFirstBuildDelete && (treeDeleter instanceof AsynchronousTreeDeleter)) { |
There was a problem hiding this comment.
Shoud this fail if --experimental_sandbox_async_tree_delete_idle_threads is 0?
Comment on lines
+357
to
+359
| "If false, sandbox deletion on the first build will be done synchronously. If true, " | ||
| + "and experimental_sandbox_async_tree_delete_idle_threads is non-0, sandbox deletion" | ||
| + "on the first build will be done asynchronously.") |
There was a problem hiding this comment.
Suggested change
| "If false, sandbox deletion on the first build will be done synchronously. If true, " | |
| + "and experimental_sandbox_async_tree_delete_idle_threads is non-0, sandbox deletion" | |
| + "on the first build will be done asynchronously.") | |
| "Enables async deletion of sanbox base folders." | |
| + "Requires --experimental_sandbox_async_tree_delete_idle_threads > 0") |
d9ca724 to
084d0ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--experimental_sandbox_async_tree_delete_on_first_build- which will enable async tree deletion on first build.