Skip to content

Commit 4b83a74

Browse files
authored
Resolved exception thrown from NuCache locking mechanism on near-simultaneous content publish requests (#19434)
* Removed the check before the wait that threw the recursive lock exception. Added additional check to ensure we don't release a lock that's already released. * Removed unnecessary check on releasing the lock.
1 parent b348b84 commit 4b83a74

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/Umbraco.PublishedCache.NuCache/ContentStore.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,12 @@ private void EnsureLocked()
321321
{
322322
if (_writeLock.CurrentCount != 0)
323323
{
324-
throw new InvalidOperationException("Write lock must be acquried.");
324+
throw new InvalidOperationException("Write lock must be acquired.");
325325
}
326326
}
327327

328328
private void Lock(WriteLockInfo lockInfo, bool forceGen = false)
329329
{
330-
if (_writeLock.CurrentCount == 0)
331-
{
332-
throw new InvalidOperationException("Recursive locks not allowed");
333-
}
334-
335330
if (_writeLock.Wait(_monitorTimeout))
336331
{
337332
lockInfo.Taken = true;

0 commit comments

Comments
 (0)