Skip to main content

Race Conditions with Automations

Automation logs that show as errors like "not found" or "destination already exists," or runs that complete without errors but skip files without any log entry, are common signs of a race condition.

Race conditions happen when multiple things interact with the same files or folders at the same time. On Files.com, this can occur when multiple Automations are all set up to act on the same source or destination location. It can also occur when Syncs or Remote Mounts target the same source or destination location being used by an Automation. Because these operations can happen simultaneously, or run at overlapping times, you cannot predict which one will run first or finish first. The outcome can include missing files, failed transfers, truncated file contents, or partial operations.

The risk is highest when one of the overlapping processes is set to delete or move files after copying. One job can try to copy a file that has already been deleted, or two jobs can try to delete the same file, which produces unpredictable behavior or log errors.

Remote Server Mounts increase the risk further. Files on mounted remote systems can still be in use or actively changing if another system or user is writing to them. When an Automation runs on a file that has not finished uploading or is still open on the remote server, the result can be an incomplete copy, a failed move, a blank copy, or file corruption.

Avoiding These Issues

Redesign your workflows so that no two processes target the same location.

If multiple Automations currently act on the same folder, consolidate them into a single Automation so the steps run in a predictable order.

If an Automation and a Sync both target the same folder, particularly when either deletes or moves files, assign each process a distinct source and destination.

Use unique Include and Exclude pattern matching in each Automation so the targets for each Automation do not overlap.