Error Oplock Break in Progress (742): Causes and Fixes

TutorialPedia Team

Date Updated

When a log entry, script, or file operation reports ERROR_OPLOCK_BREAK_IN_PROGRESS with the message "An open/create operation completed while an oplock break is underway," it means Windows finished opening a file while a caching lock on that file was still being wound down. The status almost always shows up around SMB file shares, where several users or services touch the same files at once.

The good news: this is a file-I/O status, not a system crash. The confusing news: most online "fixes" reach for registry keys that either do the wrong thing or are twenty years out of date. This guide explains what error 742 (0x2E6) actually means, how opportunistic locks and SMB leases produce it, when it is harmless, and how to resolve it with the tools current Windows releases (Windows 11 and Windows Server 2022/2025) actually provide.

Table of Contents#

What Is ERROR_OPLOCK_BREAK_IN_PROGRESS?#

The official definition: error 742 (0x2E6)#

Microsoft's Win32 system error code documentation defines ERROR_OPLOCK_BREAK_IN_PROGRESS as error 742 (0x2E6): "An open/create operation completed while an oplock break is underway." In plain terms, a create or open call was allowed to finish even though the file's opportunistic lock was in the middle of being broken — that is, another client's pending access had already forced the lock holder to give up its caching rights, and that handover had not fully completed yet.

A completion status, not a blue screen#

Despite what some troubleshooting articles claim, error 742 is not a blue screen (stop) error. Bug checks are a kernel crash mechanism with their own numbering scheme; ERROR_OPLOCK_BREAK_IN_PROGRESS is an ordinary I/O status handed to the application or component that issued the open.

Under the hood, the NT kernel uses STATUS_OPLOCK_BREAK_IN_PROGRESS, which the Windows Driver Kit explicitly documents as a success code: the operation proceeded, but an oplock break is still in flight. The Win32 subsystem maps that status to error 742. So when an application prints this error, the correct first reading is "the file opened, and a caching lock handover is still running," not "the operation failed and data was lost."

You will often see nearby codes in the same logs. Knowing the difference narrows the cause quickly:

CodeHexMessageMeaning
7420x2E6An open/create operation completed while an oplock break is underway.Open finished mid-break; a lock handover is still running.
7650x2FDAn operation is blocked waiting for an oplock.The operation is being held (pended) until a lock is granted or broken.
8000x320The oplock that was associated with this handle is now associated with a different handle.The lock moved to another handle.
8010x321An oplock of the requested level cannot be granted. An oplock of a lower level may be available.The server could only offer a weaker caching lock.
8020x322The operation did not complete successfully because it would cause an oplock to be broken. The caller has requested that existing oplocks not be broken.A no-break flag blocked the operation.
8030x323The handle with which this oplock was associated has been closed. The oplock is now broken.The lock holder closed its handle; the lock is gone.

Error 742 is the "completed anyway" case. Errors 765 and 802 are the "still waiting" or "refused to break" cases.

How Oplocks and SMB Leases Work#

Opportunistic locking basics#

An opportunistic lock (oplock) is a lock a client holds on a file that physically lives on a server, so the client can cache that file locally. While the lock is intact, reads can be served from local buffers and writes can be coalesced before they are sent, which cuts network round trips and makes remote files feel faster. The lock is "opportunistic" because the server grants it only when nothing else prevents it — as soon as another party needs the file, the lock is taken back.

Oplocks exist to keep cached data coherent: the copy on the server and the copies in client caches must agree. When coherence can no longer be guaranteed, the lock is broken and the holder is expected to flush pending writes, drop cached buffers, or close the handle before the next operation proceeds.

For SMB file shares, the network redirector requests and manages these locks automatically. Applications rarely ask for oplocks on remote files themselves; when they do request them locally, the files must be opened for overlapped (asynchronous) I/O.

Oplock types and break targets#

Oplocks come in two generations:

  • Legacy types: Level 1 (exclusive read/write caching), Level 2 (shared read caching), batch (lets a client close and reopen a file repeatedly without giving up its lock), and filter (used by scanners and filter drivers to stay out of the way of other applications).
  • Modern types (Windows 7 and later): Read, Read-Handle, Read-Write, and Read-Write-Handle oplocks, expressed as caching flags — cache-read, cache-write, and cache-handle.

When a lock is broken it degrades to one of two states: broken to Level 2 (read caching survives) or broken to None (no caching at all). Exclusive locks (Level 1, batch, filter, Read-Write, and Read-Write-Handle) require the holder to acknowledge the break; shareable Level 2/Read breaks do not, because there is no dirty data to flush.

Oplocks are also bound to handles through oplock keys (GUIDs). If the same process opens the same file a second time with a different key, the break fires just as it would for a second client — which is exactly the self-deadlock scenario that produces error 742 (see below).

SMB 2.x and 3.x leases#

Starting with SMB 2.1, Windows expresses these caching agreements as leases, which are more granular than legacy oplocks. Per the SMB2 protocol specification, a lease state combines up to three flags:

  • SMB2_LEASE_READ_CACHING (0x01) — keep read data locally
  • SMB2_LEASE_HANDLE_CACHING (0x02) — keep handles alive across closes
  • SMB2_LEASE_WRITE_CACHING (0x04) — buffer writes locally

When the server needs the file back, it sends an SMB2 Lease Break Notification carrying the current and requested lease states; if the notification is flagged as requiring an acknowledgment, the client replies with an SMB2 Lease Break Acknowledgment after it has flushed and downgraded. Directory leasing extends the same idea to directory metadata and is noted by Microsoft as improving application response times in branch offices.

One important consequence: Microsoft documents that disabling SMBv2 also disables the client oplock leasing model (plus compounding, durable handles, encryption, directory leasing, and more). That is why "turn SMB2 off" is the wrong lever for an oplock problem.

How an Oplock Break Produces Error 742#

The oplock break lifecycle#

  1. Client A holds a caching lock on a file and serves reads (and possibly writes) from its local cache.
  2. An operation that conflicts with that lock arrives — typically another client opening the file for write, or a local read, write, create, rename, or delete.
  3. The file system or SMB server issues a break request to A. The conflicting operation is held in the meantime.
  4. A flushes dirty data, drops caches, and either closes its handle or downgrades to a weaker lock, then acknowledges.
  5. Only then does the waiting operation proceed.

For read-only breaks, step 4 is skipped — there is nothing to write back. For exclusive breaks, the acknowledgment is mandatory, and the Windows driver documentation is blunt about the timing: the system waits for the acknowledgment, so the lock owner must respond promptly.

Where the error comes from: FILE_COMPLETE_IF_OPLOCKED#

Normally a create that triggers a break simply waits. But callers that cannot afford to block — for example, a component that might re-enter the same file it is currently breaking — can open with the FILE_COMPLETE_IF_OPLOCKED create option (or, in kernel mode, request the oplock with OPLOCK_FLAG_COMPLETE_IF_OPLOCKED).

That option tells the I/O stack: do not block this create waiting for the break acknowledgment — complete it now. When the create then finishes while the break is still underway, the stack returns STATUS_OPLOCK_BREAK_IN_PROGRESS instead of STATUS_SUCCESS. The Win32 layer surfaces that as ERROR_OPLOCK_BREAK_IN_PROGRESS (742).

The design purpose is deadlock avoidance. If the same client that owns the oplock re-opens the file while its own acknowledgment is outstanding, a blocking create would wait forever for itself. Completing the create immediately and reporting "break in progress" lets the caller proceed safely.

A worked timeline#

t0  Client A holds a Read-Write-Handle lease on \\fs01\data\report.xlsx
t1  Client B opens the same file for write
t2  Server sends a lease break to A (drop write + handle caching)
t3  A begins flushing its write buffer (acknowledgment still outstanding)
t4  Client A's own indexer also opens the file with FILE_COMPLETE_IF_OPLOCKED
t5  That open completes at once -> STATUS_OPLOCK_BREAK_IN_PROGRESS
    -> the app logs: ERROR_OPLOCK_BREAK_IN_PROGRESS (742)
t6  A finishes flushing and sends the lease break acknowledgment
t7  Client B's open proceeds; caching state is now consistent

At t5 nothing failed. The file was opened; the caching handshake was simply still in flight.

Common Causes in Production Environments#

  • Contended "hot" files. Shared workbooks, application config files, mail archives, and build outputs opened by several users or services at once generate a steady stream of breaks. If a second open completes mid-break, 742 appears.
  • Slow break acknowledgments. High latency WAN links, packet loss and TCP retransmits, overloaded clients, or slow server storage stretch the window in which a break is "in progress." The slower the holder responds, the more often other opens complete during that window.
  • Filter-driven access. Antivirus, backup, indexing, and sync agents open large numbers of files constantly. Each unexpected open can break a caching lock, and a busy or wedged filter driver delays the acknowledgment.
  • Applications designed around non-blocking opens. Programs and drivers that use FILE_COMPLETE_IF_OPLOCKED (storage gateways, replication tools, file-copiers) will legitimately receive 742 as a "completed with caveats" status.
  • Third-party SMB servers. NAS appliances and non-Windows SMB implementations may not support the full lease model; the SMB2 specification anticipates fallback to a batch oplock when the object store cannot lease. Mixed or buggy implementations surface break-related statuses more often.
  • Legacy configuration recipes. Old guides (written for Windows 2000/XP/Server 2003) suggest creating EnableOplocks or SMB2 registry values under LanmanServer\Parameters. Applying those blindly on modern systems either does nothing useful or disables SMB 2/3 entirely — see the registry section below.

When Error 742 Is Harmless and When It Is Not#

Error 742 is frequently benign. The open completed; the status only reports that a lock handover was still running. Microsoft's SMB troubleshooting guidance notes that many SMB errors are benign (not harmful), and STATUS_OPLOCK_BREAK_IN_PROGRESS is by definition a success code. If the application handles it, no data is at risk, and users see no symptoms, you can treat it as log noise.

Investigate further when:

  • Applications retry in a loop, spam logs, or show the error to end users as a failure.
  • The error correlates with slow file access, sharing violations, or timeouts on the same share.
  • A workload requires strict cache coherence (transactional data stores, virtual machine disks, databases) and cannot tolerate any stale cached state.
  • You see the neighboring codes (765, 801, 802) in bursts — that points to locks being refused or held far too long.

How to Fix Error Oplock Break in Progress#

1. Triage the error first#

Identify the share, path, and the client and server involved. Use PowerShell on the file server to see who holds the files:

Get-SmbOpenFile | Select-Object FileId, SessionId, Path, ClientComputerName, ClientUserName
Get-SmbSession | Select-Object ClientComputerName, ClientUserName, NumOpens

On the client, confirm the connection and protocol in use:

Get-SmbConnection

The Dialect column tells you immediately whether the session is SMB 3.x (good) or falling back to something older (bad).

Also review the share and NTFS permissions on the folder, plus the share mode and access rights the application requests when it opens the file. Over-restrictive combinations (for example, deny-write sharing on files that several services must read) turn ordinary concurrency into a churn of lock breaks and sharing violations.

2. Check network health and latency#

Breaks must be acknowledged over the network. Latency, retransmits, and resets widen the "break in progress" window. Collect a two-sided network trace while reproducing the problem — Microsoft's SMB troubleshooting article recommends capturing on both client and server and looking for TCP retransmits, resets, and slow responses before blaming SMB itself. On Windows you can capture with netsh:

netsh trace start capture=yes report=yes scenario=NetConnection level=5 maxsize=1024 tracefile=c:\Temp\netTrace.etl
# reproduce the issue
netsh trace stop

or with the NetEvent packet capture cmdlets (New-NetEventSession, Add-NetEventPacketCaptureProvider, Start-NetEventSession). For cross-site shares, look for sustained latency spikes on the WAN path.

3. Confirm the SMB dialect and signing settings#

Both ends should negotiate SMB 3.x. As of Windows 11 version 24H2 and Windows Server 2025, SMB signing is required by default, which can break connections to workgroup peers, guest shares, or third-party devices that do not sign. Microsoft's guidance is to enable signing on the remote device or replace it — not to weaken the client. SMBv1, meanwhile, is not installed by default in any edition of Windows 11 or Windows Server 2019 and later, and Microsoft strongly discourages reinstalling it. If a legacy device only works with SMBv1, fix or replace the device; reinstalling SMBv1 carries significant security risk and brings no advantage for oplock handling.

4. Keep SMB 2 and SMB 3 enabled#

Some articles suggest setting an SMB2 registry value under HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters to "0" to make oplock problems go away. That value is a protocol switch, not an oplock switch: it disables SMBv2 and SMBv3 and forces the server back to SMBv1. Microsoft documents that disabling SMBv2 removes the client oplock leasing model — along with request compounding, larger reads/writes, durable handles, improved signing, and scalability improvements — and SMBv1 has significant security vulnerabilities. If you need to disable SMBv2 for a controlled experiment, do it temporarily only:

Set-SmbServerConfiguration -EnableSMB2Protocol $false   # temporary troubleshooting only
# revert immediately afterwards:
Set-SmbServerConfiguration -EnableSMB2Protocol $true

This is never a fix for ERROR_OPLOCK_BREAK_IN_PROGRESS.

5. Adjust leasing per share instead of disabling oplocks globally#

If a particular legacy application genuinely misbehaves with caching, Microsoft's supported compatibility lever is the per-share leasing mode, not a global registry kill switch:

Get-SmbShare -Name Data | Select-Object Name, LeasingMode
Set-SmbShare -Name Data -LeasingMode Shared
  • Full — normal SMB3 lease and oplock behavior (the default design).
  • Shared — grant only read caching; no write or handle caching.
  • None — no oplocks or leases at all; behaves like SMB1. Not recommended.

The official cmdlet documentation states plainly: "We don't recommend disabling oplocks, but may be required in some scenarios." Start with Shared, and reserve None for the specific share hosting the misbehaving application while you work with its vendor on a real fix.

6. Tune server-wide lease and break behavior#

For server-wide control, use the SMB server configuration cmdlets:

Get-SmbServerConfiguration | Select-Object EnableLeasing, OplockBreakWait
  • EnableLeasing turns leasing on or off for the whole server — a big hammer; expect performance impact on latency-sensitive workloads.
  • OplockBreakWait specifies how long a create caller waits for an opportunistic lock break. If break handling on slow links takes longer than the current window allows, adjust this value instead of disabling caching outright.

Prefer per-share settings first; reach for server-wide values only after you understand which workload is stalling break acknowledgments.

7. Fix the application side#

If you maintain the software that logs the error, handle the status for what it is:

  • Treat STATUS_OPLOCK_BREAK_IN_PROGRESS / error 742 as completion with an active break, not as a hard failure — then verify state (size, timestamps, content) before trusting cached views.
  • Acknowledge break requests promptly. File system filter drivers use operations such as FSCTL_OPLOCK_BREAK_ACKNOWLEDGE and FSCTL_OPBATCH_ACK_CLOSE_PENDING to tell the system they have flushed and are done; delaying these is what creates the error window.
  • If you request oplocks directly, open files with overlapped I/O and handle break notifications through the OVERLAPPED event, GetOverlappedResult, or HasOverlappedIoCompleted.
  • Use the least intrusive access: request only the access rights you need and share as broadly as possible, so fewer operations conflict with cached locks.

8. Inspect event logs and open files#

Both SMB roles log detailed diagnostics. In Event Viewer, expand Applications and Services Logs > Microsoft > Windows > SMBClient and SMBServer (and their Operational channels) on the respective machines. Correlate the timestamps of the 742 reports with session setup, disconnects, and slow-I/O events. Combine this with the Get-SmbOpenFile / Get-SmbSession output from step 1 to identify which client is holding or breaking locks on the problem file.

About the registry values in older guides#

You will keep encountering two registry values under HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters:

  • SMB2 — a protocol-version toggle documented for older Windows releases. It has nothing to do with oplocks specifically; setting it to 0 disables SMBv2/3 (see step 4).
  • EnableOplocks — a legacy Server-service value from Windows 2000/XP/Server 2003-era documentation. On current Windows releases, Microsoft documents oplock and lease behavior through the SMBShare PowerShell module (EnableLeasing, OplockBreakWait, per-share LeasingMode) rather than hand-created registry values. If you manage a down-level file server, follow the documentation written for that OS version.

Whatever you change, note that restarting the Server service (Restart-Service LanmanServer) briefly disconnects SMB clients — schedule such restarts accordingly.

Real-World Scenarios#

  • Finance team on a shared workbook server. Two analysts open the same file within seconds; the second open completes while the first client's lease is breaking. The spreadsheet application logs 742 a few times a week. No corruption, no complaints — pure log noise from FILE_COMPLETE_IF_OPLOCKED-style opens. Action: none required beyond log filtering.
  • Nightly backup clashing with business hours. A backup agent starts early and walks every file on the share, breaking leases constantly while users still work. Opens complete mid-break and performance dips. Action: move the scan window off-hours and, if the agent misbehaves with caching, set the affected share to LeasingMode Shared.
  • Branch office over a slow WAN. Break acknowledgments take hundreds of milliseconds; users see stalls and applications log 742 bursts. Action: fix the network path first (retransmits, bandwidth), keep SMB 3 with directory leasing in play, and consider localizing the data (file server or cache near the branch) rather than disabling caching.
  • Legacy line-of-business app whose vendor says "disable oplocks." Instead of global surgery, set LeasingMode Shared (or None as a last resort) on only the share that hosts the app's data, verify the app, and keep Full everywhere else.

Best Practices to Prevent Oplock Break Errors#

  1. Keep SMB 2/3 enabled and SMBv1 uninstalled; stay current on Windows and NAS firmware so lease behavior is consistent across the estate.
  2. Prefer per-share LeasingMode tuning over server-wide or registry-level oplock disabling.
  3. Right-size file sharing flags in applications — over-restrictive share modes create conflicts that turn into breaks and sharing violations.
  4. Monitor the SMBClient/SMBServer event channels and set alerts on bursts of 742/765 rather than waiting for user complaints.
  5. Capture network traces early when break errors cluster in time or location; latency and TCP problems are the usual culprits.
  6. Keep antivirus and backup filter drivers current, and schedule heavy scans outside peak hours.
  7. Ignore Windows-2000-era registry recipes; verify every setting against current Microsoft documentation before applying it.

Conclusion#

ERROR_OPLOCK_BREAK_IN_PROGRESS (742 / 0x2E6) is a status, not a crash: an open completed while an opportunistic lock or SMB lease was still being broken. It comes from the FILE_COMPLETE_IF_OPLOCKED mechanism that keeps lock breaks deadlock-free, and it maps from the success-class NTSTATUS STATUS_OPLOCK_BREAK_IN_PROGRESS. In most environments it is benign log noise driven by concurrent access to hot files; it becomes a problem only when break acknowledgments are slow or applications mishandle the status. The reliable fixes are diagnostic — verify the dialect and signing, check the network, identify the lock holders — and surgical: tune leasing per share with Set-SmbShare -LeasingMode or, if truly needed, server-wide with Set-SmbServerConfiguration, while keeping SMB 2/3 fully enabled. Disabling SMB2 or resurrecting old registry keys makes systems slower and less secure without fixing the underlying contention.

References#

  1. System Error Codes (500–999) — Win32 apps (Microsoft Learn)
  2. Opportunistic Locks — Win32 apps (Microsoft Learn)
  3. Types of Opportunistic Locks — Win32 apps (Microsoft Learn)
  4. Breaking Opportunistic Locks — Win32 apps (Microsoft Learn)
  5. How to Request an Opportunistic Lock — Win32 apps (Microsoft Learn)
  6. Oplock semantics — Windows drivers (Microsoft Learn)
  7. Breaking Oplocks — Windows drivers (Microsoft Learn)
  8. FsRtlCheckOplockEx function (Microsoft Learn)
  9. NtCreateFile function (Microsoft Learn)
  10. [MS-SMB2] Lease Break Notification (Microsoft Learn)
  11. [MS-SMB2] Lease Break Acknowledgment (Microsoft Learn)
  12. Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows (Microsoft Learn)
  13. Set-SmbShare (Microsoft Learn)
  14. Set-SmbServerConfiguration (Microsoft Learn)
  15. Get-SmbOpenFile (Microsoft Learn)
  16. Advanced Troubleshooting Server Message Block (SMB) (Microsoft Learn)