Skip to content

Commit

Permalink
Fix bug when allowed dataset skipped by pipelines, cause it is finihsed
Browse files Browse the repository at this point in the history
  • Loading branch information
muttcg committed Aug 2, 2023
1 parent 2897f8b commit 29c5a20
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,11 @@ long searchCount(
* @param pipelineExecutionKey key of the process
*/
void markPipelineExecutionIfFinished(@Param("pipelineExecutionKey") long pipelineExecutionKey);

/**
* When interpretation is allowed for failed identifiers, execution must have running status
*
* @param pipelineExecutionKey key of the process
*/
void markPipelineExecutionAsRunning(@Param("pipelineExecutionKey") long pipelineExecutionKey);
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@
WHERE finished = false;
</update>

<update id="markPipelineExecutionAsRunning">
UPDATE pipeline_execution
SET finished = false
WHERE key = #{pipelineExecutionKey,jdbcType=BIGINT};
</update>

<select id="getRunningPipelineProcessCount" resultType="Long">
SELECT COUNT(1)
FROM pipeline_execution pe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,8 @@ public void allowAbsentIndentifiersCommon(UUID datasetKey, Integer attempt) {
process.getExecutions().stream().max(Comparator.comparingLong(PipelineExecution::getKey));

if (execution.isPresent()) {
Set<PipelineStep> steps = execution.get().getSteps();
PipelineExecution pipelineExecution = execution.get();
Set<PipelineStep> steps = pipelineExecution.getSteps();
Optional<PipelineStep> identifierStep =
steps.stream().filter(x -> x.getType() == StepType.VERBATIM_TO_IDENTIFIER).findAny();

Expand All @@ -791,6 +792,8 @@ public void allowAbsentIndentifiersCommon(UUID datasetKey, Integer attempt) {
mapper.updatePipelineStep(step);
});

mapper.markPipelineExecutionAsRunning(pipelineExecution.getKey());

// Send message to interpretaton
PipelinesVerbatimMessage message =
objectMapper.readValue(pipelineStep.getMessage(), PipelinesVerbatimMessage.class);
Expand All @@ -808,7 +811,7 @@ public void allowAbsentIndentifiersCommon(UUID datasetKey, Integer attempt) {
attempt);
} else {
LOG.warn(
"Execution ID - {} doesn't contain failed identifier step", execution.get().getKey());
"Execution ID - {} doesn't contain failed identifier step", pipelineExecution.getKey());
}
}
} catch (IOException ex) {
Expand Down

0 comments on commit 29c5a20

Please sign in to comment.