Buggy code:
@ Singleton public class DataflowRegistry { public static final String TASKS_PATH = "tasks" ; public static final String TASKS_DESCRIPTORS_PATH = ( DataflowRegistry . TASKS_PATH ) + "//descriptors" ; public static final String TASKS_AVAILABLE_PATH = ( DataflowRegistry . TASKS_PATH ) + "//executors//available" ; public static final String TASKS_ASSIGNED_PATH = ( DataflowRegistry . TASKS_PATH ) + "//executors//assigned" ; public static final String TASKS_FINISHED_PATH = ( DataflowRegistry . TASKS_PATH ) + "//executors//finished" ; public static final String TASKS_LOCK_PATH = ( DataflowRegistry . TASKS_PATH ) + "//executors//locks" ; public static final String MASTER_PATH = "master" ; public static final String MASTER_LEADER_PATH = ( DataflowRegistry . MASTER_PATH ) + "//leader" ; public static final String WORKERS_PATH = "workers" ; public static final DataMapperCallback < DataflowTaskDescriptor > TASK_DESCRIPTOR_DATA_MAPPER = new DataMapperCallback < DataflowTaskDescriptor > ( ) { @ Override public DataflowTaskDescriptor map ( String path , byte [ ] data , Class < DataflowTaskDescriptor > type ) { } } ; @ Inject @ Named ( "dataflow.registry.path" ) private String dataflowPath ; @ Inject private Registry registry ; private Node status ; private Node tasksDescriptors ; private DistributedQueue tasksAvailableQueue ; private Node tasksAssigned ; private Node tasksFinished ; private Node tasksLock ; private Node workers ; public DataflowRegistry ( ) { } public DataflowRegistry ( Registry registry , String dataflowPath ) throws Exception { } public String getDataflowPath ( ) { } public String getTasksFinishedPath ( ) { } public String getTasksAssignedPath ( ) { } public Registry getRegistry ( ) { } public DataflowDescriptor getDataflowDescriptor ( ) throws RegistryException { } @ Inject public void onInit ( ) throws Exception { } public void addAvailableTask ( DataflowTaskDescriptor taskDescriptor ) throws RegistryException { } public void addWorker ( VMDescriptor vmDescriptor ) throws RegistryException { } public void setStatus ( DataflowLifecycleStatus event ) throws RegistryException { } public DataflowTaskDescriptor assignDataflowTask ( final VMDescriptor vmDescriptor ) throws RegistryException { } public void createTaskExecutor ( VMDescriptor vmDescriptor , DataflowTaskExecutorDescriptor descriptor ) throws RegistryException { } public void updateTaskExecutor ( VMDescriptor vmDescriptor , DataflowTaskExecutorDescriptor descriptor ) throws RegistryException { } public void dataflowTaskSuspend ( final DataflowTaskDescriptor descriptor ) throws RegistryException { } public void dataflowTaskFinish ( final DataflowTaskDescriptor descriptor ) throws RegistryException { Lock lock = tasksLock . getLock ( "write" ) ; BatchOperations < Boolean > commitOp = new BatchOperations < Boolean > ( ) { @ Override public Boolean execute ( Registry registry ) throws RegistryException { Node descriptorNode = registry . get ( descriptor . getStoredPath ( ) ) ; String name = descriptorNode . getName ( ) ; descriptor . setStatus ( TERMINATED ) ; Transaction transaction = registry . getTransaction ( ) ; transaction . setData ( descriptor . getStoredPath ( ) , descriptor ) ; transaction . createChild ( tasksFinished , name , PERSISTENT ) ; <START_BUG> transaction . rdelete ( ( ( ( tasksAssigned ) + "//" ) + name ) ) ; <END_BUG> transaction . commit ( ) ; return true ; } } ; lock . execute ( commitOp , 5 , 1000 ) ; } public void dataflowTaskUpdate ( DataflowTaskDescriptor descriptor ) throws RegistryException { } public void dataflowTaskReport ( DataflowTaskDescriptor descriptor , DataflowTaskReport report ) throws RegistryException { } public void create ( DataflowTaskDescriptor descriptor , DataflowTaskReport report ) throws RegistryException { } public List < DataflowTaskDescriptor > getTaskDescriptors ( ) throws RegistryException { } public DataflowTaskDescriptor getTaskDescriptor ( String taskName ) throws RegistryException { } public DataflowTaskReport getTaskReport ( DataflowTaskDescriptor descriptor ) throws RegistryException { } public List < DataflowTaskReport > getTaskReports ( List < DataflowTaskDescriptor > descriptors ) throws RegistryException { } public VMDescriptor getDataflowMaster ( ) throws RegistryException { } public List < VMDescriptor > getDataflowMasters ( ) throws RegistryException { } public List < VMDescriptor > getWorkers ( ) throws RegistryException { } public List < String > getWorkerNames ( ) throws RegistryException { } public List < DataflowTaskExecutorDescriptor > getExecutors ( String worker ) throws RegistryException { } }

Fix:
transaction . rdelete ( ( ( ( tasksAssigned . getPath ( ) ) + "//" ) + name ) ) ;