dionusos commented on a change in pull request #64: URL: https://github.com/apache/oozie/pull/64#discussion_r783241607
########## File path: core/src/main/java/org/apache/oozie/command/wf/SignalXCommand.java ########## @@ -468,21 +468,54 @@ else if (!workflowActionBeanListForForked.isEmpty() && !checkForSuspendNode(work public void startForkedActions(List<WorkflowActionBean> workflowActionBeanListForForked) throws CommandException { - List<CallableWrapper<ActionExecutorContext>> tasks = new ArrayList<CallableWrapper<ActionExecutorContext>>(); List<UpdateEntry> updateList = new ArrayList<UpdateEntry>(); List<JsonBean> insertList = new ArrayList<JsonBean>(); boolean endWorkflow = false; boolean submitJobByQueuing = false; - for (WorkflowActionBean workflowActionBean : workflowActionBeanListForForked) { - LOG.debug("Starting forked actions parallely : " + workflowActionBean.getId()); - tasks.add(Services.get().get(CallableQueueService.class).new CallableWrapper<ActionExecutorContext>( - new ForkedActionStartXCommand(wfJob, workflowActionBean.getId(), workflowActionBean.getType()), 0)); - } try { - List<Future<ActionExecutorContext>> futures = Services.get().get(CallableQueueService.class) - .invokeAll(tasks); + /** + * The limited thread execution mechanism aims to solve the dead-lock when all active threads are + * executing the SignalXCommand's invokeAll method. + * + * Solution + * 1. Need to limit directly invokeAll call when the num of rest threads is less than the tasks + * 2. To obtain correct active threads number in callableQueue, the SignalXCommand.class lock is needed. + * + */ + CallableQueueService callableQueueService = Services.get().get(CallableQueueService.class); + List<Future<ActionExecutorContext>> futures = new ArrayList<>(); + + synchronized (SignalXCommand.class) { Review comment: I am a little bit worried about this lock but I cannot explain it why. Let me go through this once more. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@oozie.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org