-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
…st was sorted desc, Fixed to reset maxNode only when nodeId is greater than last
@@ -321,7 +321,9 @@ public boolean handle(Pair<Long, NodeRef> nodePair) | |||
if (nodes.size() < maxItemBatchSize) | |||
{ | |||
nodes.add(nodePair.getSecond()); | |||
maxNodeId = nodePair.getFirst(); | |||
if(nodePair.getFirst() > maxNodeId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the formatting settings of your IDE. The braces should be on new lines and a whitespace between "if" and the condition clause.
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY, true); | ||
// stop propagating on children nodes | ||
return false; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unnecessary empty lines.
* If async call required adds ASPECT_PENDING_FIX_ACL aspect to nodes when transactionTime reaches max admitted time | ||
* MNT-18308: No longer checks if call is async in order to evaluate time passed to decide if nodes should be processed by job. | ||
* This is now the default behavior for both sync and async calls: when fixedAclMaxTransactionTime is exceeded, call turns | ||
* async and all remaining nodes should be processed by job FixedACLUpdater |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a description of the method signature in this JavaDoc (parameters and return value description)?
@@ -68,7 +68,8 @@ | |||
private FileFolderService fileFolderService; | |||
private Repository repository; | |||
private FixedAclUpdater fixedAclUpdater; | |||
private NodeRef folderNodeRef; | |||
private NodeRef mnt15368folder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove references to JIRA tickets from variables. Use meaningful names instead.
@@ -225,6 +231,66 @@ public Void execute() throws Throwable | |||
} | |||
}, false, true); | |||
} | |||
|
|||
@Test | |||
public void testMNT18308() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove references to JIRA tickets from methods. Use meaningful names instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to unite this test with testMNT15368 to avoid code duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testMNT15368 is setting inherit permissions forcing async: permissionService.setInheritParentPermissions(mnt15368folder, false, true);
In order to test MNT-18308 we need to set them sync:
permissionService.setInheritParentPermissions(mnt18308folder, false, false);
In fact, with these changes now, the behavior is exactly the same, so the async/sync flag does not make a difference as async calls behave the same as sync calls until time is exceeded and now sync calls behave the same as async calls when time was exceeded.
testMNT15368 was kept to assert previous behavior is the same on async calls
testMNT18308 was added to assure that a sync call turns async after transaction time was exceeded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just trying to highlight that the tests are only different in the first part. The majority of the test is a copy-paste which is discouraged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, but i cannot reproduce both issues by reapplying the permissions to the previous tree the other test ran on. I'm not sure how I could unite them. Best I can do I think create methods that both call. Do you agree or did you have a better solution in mind?
src/main/java/org/alfresco/repo/domain/permissions/ADMAccessControlListDAO.java
Show resolved
Hide resolved
if (log.isWarnEnabled() && (AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY) == null | ||
|| (Boolean) AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY) == false)) | ||
{ | ||
log.warn("Time was exceeded in transaction " + AlfrescoTransactionSupport.getTransactionId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to propose to change the message to be a bit more precise:
"The ACL processing time in transaction X exceeded the configured limit of Y ms. The rest of the ACL processing will be done asynchronously."
I guess it is ok to omit some of the information, as the elapsed time (transactionTime) will be very close to the limit and the exact date when this happened will be in the log statement anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Please see my comment about the log message and the test. Other than that it is ok to merge.
Replaces PR #984
Implements solution provided by @killerboot :
Aditionally also contains: