ERROR_CANNOT_BREAK_OPLOCK - 802 (0x322)

The operation did not complete successfully because it would cause an oplock to be broken. The caller has requested that existing oplocks not be broken.

Updated: Feb 21, 2026

Technical Background

The ERROR_CANNOT_BREAK_OPLOCK error (802, 0x322) is a specific Windows error that occurs when an operation would break an existing opportunistic locking (oplock) session but the caller has explicitly requested that such oplocks not be broken. This error is typically encountered in network file access scenarios where clients and servers use oplocks to optimize performance.

Error Details

Oplocks are a mechanism used by Windows to reduce the number of round-trip communications between a client and server when accessing files over a network. An oplock occurs when a client locks a file, and the server defers sending updates to other clients until the lock is released. Breaking an oplock can cause data inconsistencies if not handled properly.

Common Causes

  • Invalid Parameter Values: The operation was attempted with parameters that would have broken an existing oplock, but the caller has explicitly requested that no such breaks occur.
  • Incorrect Object Type: The operation was applied to a directory or other object type where oplocks are not applicable.
  • Exceeding Limits: The system may have limits on how many concurrent oplocks can be broken in a given context.

Real-World Context

This error is commonly encountered in network file access scenarios, particularly when using SMB (Server Message Block) protocols. It can also occur in distributed file systems or when working with networked storage solutions that rely on oplocks for performance optimization.

Is This Error Critical?

The criticality of this error depends on the specific operation and context. If the operation is non-critical, such as a read operation, the impact may be minimal. However, if the operation involves modifying a file or directory, it could lead to data inconsistencies or other issues.

How to Diagnose

  1. Review Operation Context: Ensure that the operation being performed is appropriate for the object type and does not conflict with existing oplocks.
  2. Validate Parameters: Verify that all parameters are correct and do not inadvertently request the breaking of an oplock.
  3. Confirm Object Types: Ensure that the operation is applied to a file, rather than a directory or other non-file object where oplocks may not be applicable.
  4. Verify Input Data: Check for any corrupted data or invalid input that could trigger this error.

How to Resolve

  1. Correct Parameter Usage: Adjust the parameters of the operation to ensure they do not conflict with existing oplocks.
  2. Adjust Operation Context: Modify the context in which the operation is being performed to avoid breaking oplocks, if possible.
  3. Restore Data: If data corruption or invalid input is suspected, restore the affected files or directories.
  4. Retry Operation with Valid Inputs: Attempt the operation again with valid inputs that do not conflict with existing oplocks.

Developer Notes

When working with network file access operations in Windows, it is important to understand and respect the behavior of oplocks. Ensure that your application logic does not inadvertently request the breaking of an oplock when such a break would be undesirable or harmful.

Related Errors

FAQ

Q: What is an oplock?

A: An oplock, short for opportunistic lock, is a mechanism used by Windows to optimize network file access. It allows the server to defer sending updates to other clients until the current client releases its locks.

Q: Why would I encounter this error?

A: You might encounter this error when an operation would break an existing oplock but your application has explicitly requested that no such breaks occur.

Q: How can I prevent this error from occurring?

A: Ensure that your application logic respects the conditions under which oplocks are broken and avoid requesting their breaking in contexts where it is not appropriate.

Summary

The ERROR_CANNOT_BREAK_OPLOCK (802) error indicates that an operation would break an existing oplock, but such a break has been explicitly disallowed. This error is commonly encountered in network file access scenarios and can be resolved by adjusting the parameters or context of the operation to avoid breaking oplocks where it is not desired.