-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DeleteTreesBelow in jni to avoid errors
Before this change when the value of experimental_sandbox_async_tree_delete_idle_threads was higher than 0 there were errors caused by the asynchronous deletion being done concurrently while other parts of Bazel (specifically in Bazel tests) also deleted the same directories. If we tried to delete a file or directory that wasn't there, we'd get a FileNotFound exception in Java triggered by the ENOENT system error. But it's reasonable to simply ignore these errors in DeleteTreesBelow and continue deleting whatever needs to be deleted since the end result is the same. This fix is in preparation for changing the default value of experimental_sandbox_async_tree_delete_idle_threads. In this CL I also added a TODO to improve the handling for macOS and other OSs to account for unspecified behavior of readdir(). Neither this CL nor a value higher than 0 for experimental_sandbox_async_tree_delete_idle_threads would introduce a problem in the code, the problem was already there. Asynchronous deletion may make it more likely for the problem to surface but the likelihood is still very low. RELNOTES:none PiperOrigin-RevId: 573224536 Change-Id: I4989ab5860de711e3071e23700b4367d9f4e7b69
- Loading branch information
1 parent
175a18d
commit d6c79db
Showing
1 changed file
with
65 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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