Basically, oplocks (Opportunistic Locking) are used to manage file access, ensuring exclusive use by applications that require it.
By default oplocks are enabled in Resilio Active Everywhere Agents. To disable add custom parameter fs_opplocks_enabled:false
to Agent or Job profile.
This guide outlines how oplocks function and the best practices for configuring them.
Keeping oplocks enabled:
Files listed in the FileDelayConfig are subject to oplocks rules. If oplocks are additionally disabled via the custom parameter, these files will be processed with the delay specified in the configuration, without additional access restrictions.
- Exclusive Access Notification: When oplocks are enabled, an application that opens a file (for reading or writing) will trigger a notification to another applications that also keep this file open. The Resilio Agent will then close its handles, granting exclusive access to the new application.
- Application Requirements: This is critical for applications that need exclusive access to files, such as Microsoft Word. Without oplocks, Word will generate an error if it tries to open a file already in use by another application.
- Local Disks Only: Oplocks are effective only on local disks. They do not apply to files accessed via SMB or NFS. Oplocks are automatically disabled for network drives.
Keeping oplocks disabled:
- No Exclusive Access Control: If oplocks are disabled, the system does not manage exclusive file access. An application can open a file without receiving notifications about active handles from other applications, potentially causing conflicts in shared access environments.
False Occupancy Detection:
The system may occasionally misidentify a file as being in use. If this happens frequently, it is advisable to either disable oplocks or properly configure the FileDelayConfig to avoid disruptions.