Skip to content

Spurious Windows errors on CI #5481

Closed
@ehuss

Description

@ehuss

changing_bin_features_caches_targets and rename_with_link_search_path fail frequently on AppVeyor.

I have been doing some investigation and I have narrowed down some small, reliable reproductions. In general, it appears that attempting to rename or unlink a binary immediately after executing it causes problems. It's as-if there is a ghost entry left behind that causes further attempts to replace it with a new file, or to delete its parent to fail.

I have a test that does this in a loop, and it fails after some number of iterations (tends to happen very fast on AppVeyor):

  1. Link B to A
  2. Run A
  3. Delete A
  4. Link C to A
  5. Run A
  6. Delete A

The link calls will sometimes fail with "access denied". I have even noticed that A.exists() is true immediately after the call to unlink!

It is unrelated to hard-links, copying the file fails, too. It's also not specific to Rust, since I've been able to repro with Python.

I have Defender disabled, indexing disabled, and it's not related to mspdbsrv (although all 3 of those can make it substantially worse).

A workaround is to add a 1 second delay after executing a file before deleting it. However, I'm going to continue investigating to figure out why this happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions