Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 1.42 KB

File metadata and controls

29 lines (16 loc) · 1.42 KB

Kill process locking file

When a verification writes a .received.* file, the operation can fail if another process (for example, an editor or a previously launched diff tool) is holding a lock on that file. The exception surfaces as an IOException: "The process cannot access the file because it is being used by another process".

Verify can detect those processes via the Windows Restart Manager and terminate them so the write can be retried.

Enable

Set the Verify_KillProcessLockingFile environment variable to true.

When enabled, on Windows, any IOException raised during a snapshot file write triggers a lookup of every process holding a handle to the target path. Each such process is killed and the write is retried once.

Platform support

The feature only runs on Windows, since the Restart Manager API is Windows-only. On other platforms, the environment variable has no effect.

Caveats

Killing processes is destructive. Enable this only in environments where losing the work in those processes is acceptable, such as CI machines or developer machines where the only processes that would lock these files are short-lived diff or editor processes.