Skip to content

Commit

Permalink
fix(core): Revert lock conflict test in DefaultOperationLockManager
Browse files Browse the repository at this point in the history
Also add a comment on how it is supposed to work.
  • Loading branch information
apeteri committed Dec 6, 2024
1 parent 1f625ab commit 5ee5cf8
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,15 @@ protected void canContextLockTargets(final DatastoreLockContext context, final I
if (!isDisposed()) {
for (final Lockable newTarget : targets) {
for (final IOperationLock existingLock : getExistingLocks()) {
if (existingLock.targetConflicts(newTarget) || !canContextLock(context, existingLock)) {
/*
* Conflicting targets _are_ allowed provided the contexts are nested properly.
* For example, the following sequence is allowed:
*
* - first lock locks all content with description "maintenance"
* - second lock locks a single repository with description "commit",
* parent description "maintenance", same user
*/
if (existingLock.targetConflicts(newTarget) && !canContextLock(context, existingLock)) {
alreadyLockedTargets.put(newTarget, existingLock.getContext());
}
}
Expand Down

0 comments on commit 5ee5cf8

Please sign in to comment.