Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,20 @@ public void run() {
((Deleter<P>) dependentResourceNode.getDependentResource()).delete(primary, context);
deleteCalled.add(dependentResourceNode);
}
alreadyVisited.add(dependentResourceNode);
boolean deletePostConditionMet =
deletePostCondition.map(c -> c.isMet(primary,
dependentResourceNode.getDependentResource().getSecondaryResource(primary)
.orElse(null),
context)).orElse(true);

if (deletePostConditionMet) {
alreadyVisited.add(dependentResourceNode);
handleDependentCleaned(dependentResourceNode);
} else {
// updating alreadyVisited needs to be the last operation otherwise could lead to a race
// condition in handleCleanup condition checks
postDeleteConditionNotMet.add(dependentResourceNode);
alreadyVisited.add(dependentResourceNode);
}
} catch (RuntimeException e) {
handleExceptionInExecutor(dependentResourceNode, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ public void run() {
alreadyVisited.add(dependentResourceNode);
handleDependentDeleted(dependentResourceNode);
} else {
// updating alreadyVisited needs to be the last operation otherwise could lead to a race
// condition in handleDelete condition checks
deletePostConditionNotMet.add(dependentResourceNode);
alreadyVisited.add(dependentResourceNode);
}
Expand Down