Handle new delete_pending
error code when stating index unit files
#8838
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.
Multiple clang processes race to write out the same index file via renaming a newly generated index file ontop of the stale one. On Windows, there is a small window where the destination path is marked for deletion, and querying the file at this time would return a misleading
permission_denied
error (which is the Win32 error mapping from the underlying NTSTATUS codeSTATUS_DELETE_PENDING
). An upstream change has modified thefs::status
function on Windows to detect this case and return a more accuratedelete_pending
error code, which can be handled here as if the file is already deleted (i.e.no_such_file_or_directory
).The
delete_pending
error code was introduced here: llvm#90655cc @compnerd