Skip to content

ParallelLoop task index Bug? #40

@eyes4

Description

@eyes4

src/tasks/LoopCharacteristics.js from line 169:

ParallelLoopCharacteristics.prototype._onCompleteMessage = function onCompleteMessage(routingKey, message) {
  const chr = this.characteristics;
  const {
    content
  } = message;
  if (content.output !== undefined) chr.output[content.index] = content.output;
  if (routingKey === 'execute.discard') {
    this.discarded++;
  }
  this.running--;
  this.activity.broker.publish('execution', 'execute.iteration.completed', {
    ...content,
    ...chr.getContent(),
    index: this.index,                    // >>>>>>>  this line 
    running: this.running,
    discarded: this.discarded,
    output: chr.output,
    state: 'iteration.completed',
    preventComplete: true
  });

The marked line should probably be removed, as the index is already included in the content, whereas in parallel tasks, the value of this.index = tasks.length +1 after the parallel tasks are started in batches

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions