Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
FALCON-2335 Entity update should not lock the cluster entity
Author: pallavi-rao <pallavi.rao@inmobi.com>

Reviewers: @sandeepSamudrala

Closes #409 from pallavi-rao/2335
  • Loading branch information
pallavi-rao committed Aug 9, 2018
1 parent 411d90c commit 90c955db16739ce6b6671576264fc89ebcdde009
Showing 1 changed file with 10 additions and 8 deletions.
@@ -565,14 +565,16 @@ private void obtainEntityLocks(Entity entity, String command, List<Entity> token
//now obtain locks for all dependent entities if any.
Set<Entity> affectedEntities = EntityGraph.get().getDependents(entity);
for (Entity e : affectedEntities) {
if (memoryLocks.acquireLock(e, command)) {
tokenList.add(e);
LOG.debug("{} on entity {} has acquired lock on {}", command, entity, e);
} else {
LOG.error("Error while trying to acquire lock on {}. Releasing already obtained locks",
e.toShortString());
throw new FalconException("There are multiple update commands running for dependent entity "
+ e.toShortString());
if (e.getEntityType() != EntityType.CLUSTER) {
if (memoryLocks.acquireLock(e, command)) {
tokenList.add(e);
LOG.debug("{} on entity {} has acquired lock on {}", command, entity, e);
} else {
LOG.error("Error while trying to acquire lock on {}. Releasing already obtained locks",
e.toShortString());
throw new FalconException("There are multiple update commands running for dependent entity "
+ e.toShortString());
}
}
}
}

0 comments on commit 90c955d

Please sign in to comment.