-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Windows: rebuild and clean sometimes fail with DirectoryNotEmptyException #5907
Comments
Does |
Yes, it took me three times although. |
Can you repro reliably? |
It happens constantly for me in the following situation:
|
But I'm using 0.15.2, I'll try if it still happens with 0.16.1 |
I believe @meteorcloudy is working on this -- reassigning. |
…an up directory Related: #5907 RELNOTES: None PiperOrigin-RevId: 209735282
@meteorcloudy , have you seen this error with recent releases? |
I haven't seen this after setting my output user root to |
Reopen since @laszlocsomor and I have both been seeing this issue for a while again, I'll look into it. |
`bazel clean` command sometimes fails on Windows with "Directory not empty" error. But when checking the directory after the failure, we don't see any file or directory under it. After debugging, we cannot find any unclosed file handle, either. However, when trying to delete the bazel output directory with `rm -rf" it succeeds everytime. The reason is that Cygwin worked around a Windows issue at this commit: Alexpux/Cygwin@28fa2a7 The problem is, I quote: "" Intensive testing shows that sometimes directories, for which the delete disposition has already been set, and the deleting handle is already closed, can linger in the parent dir for a couple of ms for no apparent reason (Windows Defender or other real-time scanners are suspect). "" In this commit, we use a similar way to retry deleting the directory when its "deleted" sub-dirs are still lingering under it. Related bazelbuild#5907
Related stackoverflow question: https://stackoverflow.com/questions/31606978/odd-behaviour-when-deleting-files-with-files-delete |
That was a great read, thanks! |
`bazel clean` command sometimes fails on Windows with "Directory not empty" error. But when checking the directory after the failure, we don't see any file or directory under it. After debugging, we cannot find any unclosed file handle, either. However, when trying to delete the bazel output directory with `rm -rf" it succeeds everytime. The reason is that Cygwin worked around a Windows issue at this commit: Alexpux/Cygwin@28fa2a7 The problem is, I quote: "" Intensive testing shows that sometimes directories, for which the delete disposition has already been set, and the deleting handle is already closed, can linger in the parent dir for a couple of ms for no apparent reason (Windows Defender or other real-time scanners are suspect). "" In this commit, we use a similar way to retry deleting the directory when its "deleted" sub-dirs are still lingering under it. Related #5907 Closes #7462. PiperOrigin-RevId: 234777436
@meteorcloudy : Can we close this bug? |
ping |
@laszlocsomor Sorry for the late response. Not yet, because in the JavaSimpleLibraryBuilder I sometimes still get DirectoryNotEmpty exception while rebuilding. It is not using our JNI code to delete file and directory, instead it uses Did you ever have the same error? |
Thanks for the update! I don't remember clearly anymore if I've seen it or not. |
Basically I can reproduce after about 50 commits change in Bazel repo,
|
@meteorcloudy : Any updates? Is P1 still adequate? |
I am not working on this recently. I'm not getting any report from users, so I guess P2 should be more appropriate. But I can still reproduce this bug on my local machine, so I'll keep it open. |
Hey @meteorcloudy , I'd like to take a look at this. Can you still repro this locally? Could you help me repro? |
@laszlocsomor , thanks! |
Just reset to an old enough commit which will trigger a rebuild for most of Java code. |
This issue will be fixed from guava side, there's internal work going on, so I'm closing this one. |
…ean up directory Related: bazelbuild/bazel#5907 RELNOTES: None PiperOrigin-RevId: 209735282
When I use Bazel 0.15.2 to rebuild Bazel I got this error sometimes:
FYI @laszlocsomor
The text was updated successfully, but these errors were encountered: