Skip to content

Commit

Permalink
Possible fix for one of the ocasional test failures (MID-3048)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed May 20, 2016
1 parent 49970cc commit f685b46
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -1161,7 +1161,14 @@ public <F extends ObjectType> void loadFullShadow(LensContext<F> context, LensPr
FocusType focusType = (FocusType) focusCurrent.asObjectable();
for (ObjectReferenceType linkRef: focusType.getLinkRef()) {
if (linkRef.getOid().equals(projCtx.getOid())) {
throw new SystemException("Internal error: the old OID "+projCtx.getOid()+" still exists in the linkRef ("+focusCurrent+")");
// The deleted shadow is still in the linkRef. This should not happen, but it obviously happens sometimes.
// Maybe some strange race condition? Anyway, we want a robust behavior and this linkeRef should NOT be there.
// So simple remove it.
LOGGER.warn("The OID "+projCtx.getOid()+" of deleted shadow still exists in the linkRef after discovery ("+focusCurrent+"), removing it");
ReferenceDelta unlinkDelta = ReferenceDelta.createModificationDelete(
FocusType.F_LINK_REF, focusContext.getObjectDefinition(), linkRef.asReferenceValue().clone());
focusContext.swallowToSecondaryDelta(unlinkDelta);
continue;
}
boolean found = false;
for (LensProjectionContext pCtx: context.getProjectionContexts()) {
Expand Down

0 comments on commit f685b46

Please sign in to comment.