[ https://issues.apache.org/jira/browse/OOZIE-3646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17458267#comment-17458267 ]
Dénes Bodó commented on OOZIE-3646: ----------------------------------- [~zuston] Thanks for catching this. I didn't take a deeper look but could you please also provide unit tests for this change. A test which can result in deadlock with the old code but passes with the new code would be great. Thanks > Possible dead-lock in SignalXCommand > ------------------------------------ > > Key: OOZIE-3646 > URL: https://issues.apache.org/jira/browse/OOZIE-3646 > Project: Oozie > Issue Type: Bug > Reporter: Junfan Zhang > Priority: Major > > The limited thread execution mechanism aims to solve the dead-lock when all > active threads are executing the SignalXCommand's invokeAll method. > h2. Dead-lock when to happen > Assuming that Oozie CallableQueue thread pool size is 120, when all threads > are executing the {{SignalXCommand.startForkedActions}} method, a deadlock > occurs. > Because in {{SignalXCommand.startForkedActions}}, the code of > {{List<Future<ActionExecutorContext>> futures = > Services.get().get(CallableQueueService.class) > .invokeAll(tasks);}} will be sync executed, however now > all callableQueue threads are busy. > h2. 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. -- This message was sent by Atlassian Jira (v8.20.1#820001)