Skip to content

FileSystem - consider making directory creation invulnerable to transient UnauthorizedAccessException #106

Description

@madelson

For file locks, we have this line of code:

                try { System.IO.Directory.CreateDirectory(this.Directory); }
                catch (Exception ex)
                {
                    throw new InvalidOperationException($"Failed to ensure that lock file directory {this.Directory} exists", ex);
                }

Very rarely when running TestParallelism, I've seen this fail with UnauthorizedAccessException, presumably due to some form of concurrent directory creation. We can make this less vulnerable by being willing to retry directory creation a certain number of times when hitting that particular exception.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions