OverlappingFileLockException Error during Workflow Execution

Problem

During the workflow execution, an OverlappingFileLockException error occurs. 

ERROR: Internal error occurred during run of the plan: java.nio.channels.OverlappingFileLockException[STEP my_custom_lookup.lkp[Lookup Builder]]java.nio.channels.OverlappingFileLockException

Solution

OverlappingFileLockException error occurs, when the lookup file is accessed multiple times by the Lookup Builder. The situation can occur when one plan is run multiple times via different workflows. To fix this error, modify your workflow the way, that plans are executed one after another and not in parallel

Use Workflow Resource to avoid OverlappingFileLockException

  1. Define a Workflow Resource in the server config file with 100 units (this will be the maximum number of tasks that can access the lookup for reading, so it should be a big number).

     ...
       <components class="com.ataccama.adt.web.WorkflowServerComponent">
          ...
          <resourcesConfiguration>
             <resources>
                <resource id="lookup_lock" units="100" name="Lookup Lock"/>
             </resources>
          </resourcesConfiguration>
       ...
       </components>
  2. Configure any Workflow Task that builds the lookup with Lookup Builder to require all units of this resource.
  3. Configure any Workflow Tasks that use the lookup with Lookup, Apply Replacements or any other step to require one unit of this resource.
This way only one workflow task can build the lookup at a time and only when no other Task is using it. Also, the scenario above prevents the Lookup Builder from modifying a lookup which is currently used by a different plan.