Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-3004

Forked action retry info is not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0b1
    • None
    • None

    Description

      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.

      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);
                  }
              }
      
      

      And when forked submission completes, the temporary map is written to the workflow instance.

      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));
                      }
      

      The logic for writing to the temporary map is incorrect. It should be

      public void setVar(String name, String value) {
                  if (value == null) {
                      contextVariableMap.remove(name);
                  }
                  else {
                      contextVariableMap.put(name, value);
                  }
              }
      

      Attachments

        1. screenshot-1.png
          55 kB
          Purshotam Shah
        2. OOZIE-3004-V1.patch
          6 kB
          Purshotam Shah
        3. OOZIE-3004-V2.patch
          5 kB
          Purshotam Shah

        Activity

          People

            puru Purshotam Shah
            puru Purshotam Shah
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: