Skip to content

Commit

Permalink
fix(kafka-runner): restart & change status of an execution don't laun…
Browse files Browse the repository at this point in the history
…ch depending flows

close #607
  • Loading branch information
tchiotludo committed Jun 23, 2022
1 parent c4d6cca commit 4a61af4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public StreamsBuilder topology() {
this.handleWorkerTaskExecution(workerTaskExecutionKTable, stream);

// purge at end
this.purgeExecutor(stream);
this.purgeExecutor(executorKStream);

this.purgeWorkerRunning(workerTaskResultKStream);

Expand Down Expand Up @@ -332,6 +332,17 @@ private void purgeExecutor(KStream<String, Executor> stream) {
NEXTS_DEDUPLICATION_STATE_STORE_NAME
);

// clean up Flow Trigger deduplication state
terminated
.transformValues(
() -> new DeduplicationPurgeTransformer<>(
TRIGGER_DEDUPLICATION_STATE_STORE_NAME,
(key, value) -> value.getExecution().getId()
),
Named.as("PurgeExecutor.purgeTriggerDeduplication"),
TRIGGER_DEDUPLICATION_STATE_STORE_NAME
);

// clean up killed
terminated
.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,9 @@ void standard() {
assertThat(workerTaskRunningOutput().readRecord().value(), is(nullValue()));
assertThat(workerTaskRunningOutput().isEmpty(), is(true));

// executor topic must be deleted @TODO: 2 null values
// executor topic must be deleted
TestRecord<String, Executor> executor = executorOutput().readRecord();
assertThat(executor.value(), is(nullValue()));
executor = executorOutput().readRecord();
assertThat(executor.value(), is(nullValue()));
assertThat(executorOutput().isEmpty(), is(true));
}

Expand Down

0 comments on commit 4a61af4

Please sign in to comment.