[ 
https://issues.apache.org/jira/browse/OOZIE-3004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16096780#comment-16096780
 ] 

Purshotam Shah commented on OOZIE-3004:
---------------------------------------

bq. Purshotam Shah nice catch. Could you please add technical cause and 
solution in brief?
Updated description.

> Forked action retry info is not working
> ---------------------------------------
>
>                 Key: OOZIE-3004
>                 URL: https://issues.apache.org/jira/browse/OOZIE-3004
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Purshotam Shah
>            Assignee: Purshotam Shah
>         Attachments: OOZIE-3004-V1.patch, OOZIE-3004-V2.patch, 
> screenshot-1.png
>
>
> UI shows N/A for start time and console URL
> We do parallel job submission for forked actions, and each job submission 
> needs to update workflow instance. 
> To avoid data race, ForkedActionStartXCommand write  workflow instance to a 
> temporary map.
> {code:title=ForkedActionExecutorContext.java}
> private Map<String, String> contextVariableMap = new HashMap<String, 
> String>();
>         public ForkedActionExecutorContext(WorkflowJobBean workflow, 
> WorkflowActionBean action, boolean isRetry,
>                 boolean isUserRetry) {
>             super(workflow, action, isRetry, isUserRetry);
>         }
>         public void setVar(String name, String value) {
>             if (value != null) {
>                 contextVariableMap.remove(name);
>             }
>             else {
>                 contextVariableMap.put(name, value);
>             }
>         }
> {code}
> And when forked submission completes, the temporary map is written to the 
> workflow instance.
> {code:title=SignalXCommand.java}
> List<Future<ActionExecutorContext>> futures = 
> Services.get().get(CallableQueueService.class)
>                     .invokeAll(tasks);
>             for (Future<ActionExecutorContext> result : futures) {
>                 if (result == null) {
>                     submitJobByQueuing = true;
>                     continue;
>                 }
>                 ActionExecutorContext context = result.get();
>                 Map<String, String> contextVariableMap = 
> ((ForkedActionExecutorContext) context).getContextMap();
>                 LOG.debug("contextVariableMap size of action " + 
> context.getAction().getId() + " is " + contextVariableMap.size());
>                 for (String key : contextVariableMap.keySet()) {
>                     context.setVarToWorkflow(key, 
> contextVariableMap.get(key));
>                 }
> {code}
> The logic for writing to the temporary map is incorrect. It should be
> {code}
> public void setVar(String name, String value) {
>             if (value == null) {
>                 contextVariableMap.remove(name);
>             }
>             else {
>                 contextVariableMap.put(name, value);
>             }
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to