helix icon indicating copy to clipboard operation
helix copied to clipboard

Targeted TaskConfigMaps are never communicated to Task.

Open manishrawat1992 opened this issue 3 years ago • 0 comments

Describe the bug

When I add configMap to Targeted Task. It is not communicated in the Task executionContext

To Reproduce

Create a targeted task with a custom configMap. Task is not invoked with that config.

        jobBuilder.setTaskRetryDelay(0);
        jobBuilder.setMaxAttemptsPerTask(10);
        jobBuilder.setNumConcurrentTasksPerInstance(100);
        jobBuilder.setRebalanceRunningTask(false);
        jobBuilder.setTargetResource(resourceName);
        jobBuilder.setTargetPartitionStates(Sets.newHashSet(LeaderOfflineSMD.States.LEADER.name()));

        List<TaskConfig> taskCfgs = Lists.newArrayList();

        for(int i = 0; i < num_partitions; i++) {
            String target = getPartitionName(resourceName, i);
            TaskConfig taskCfg = new TaskConfig.Builder()
                    .addConfig("configs", jobConfig)
                    .setCommand("OplogCopy")
                    .setTaskId(String.valueOf(i))
                    .setTargetPartition(target)
                    .build();

            taskCfgs.add(taskCfg);
        }
        jobBuilder.addTaskConfigs(taskCfgs);

Expected behavior

The configMap is successfully communicated to Task

Additional context

This is because during building JobConfig class using Builder, the field variable _targetedTaskConfigMap is never populated. This is required in Workflow.java in function addJob() which calls getTaskConfigMap() in JobConfig, returning empty map from _targetedTaskConfigMap.

manishrawat1992 avatar Jul 04 '22 15:07 manishrawat1992