AnsweredAssumed Answered

Folder creation conflict in clustered environment with policy

Question asked by signjoy on Apr 17, 2018
Latest reply on Apr 18, 2018 by signjoy



We have two nodes in a cluster.  Whenever a new file comes in a DROP folder a onUpdatePolicy runs and move the document to the appropriate folder. 


We have metadata called caseNumber. So if the caseNumber is 12345678 then the onUpdatePolicy will create a folder structure like 12->123->12345->12345678->abc.pdf. 




We have to bulk import around 50 documents with the same caseNumber 12345678.

During the bulk import if two documents comes at the same time in the DROP folder, the policy will run on both the nodes and  it creates a race condition between two threads or nodes and one thread/node is throwing duplicate folder exception. 


I also tried to write a simple JavaScript based rule that will move the documents as when they created into DROP folder. It also throws the same exception or some documents are not getting moved.


For the time being I have written a Scheduler that moves the documents at certain interval. But I would like to know if there is a better way to do this with policy.


Alfresco 5.1.2


Thank you