mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(swf): deliver Lambda outcomes through one decision task (#5859)
Signed-off-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
1 parent
de94e3cfcc
commit
e1fe876149
2 files changed
+64
-12
No files matched your search
@@ -548,6 +548,7 @@ public class SwfService implements Resettable {
|
||||
}
|
||||
|
||||
task.setState(SwfDecisionTask.STATE_STARTED);
|
||||
execution.setDecisionNeeded(false);
|
||||
task.setIdentity(identity);
|
||||
task.setStartedTimestamp(now());
|
||||
SwfHistoryEvent started = appendEvent(execution, "DecisionTaskStarted");
|
||||
@@ -1275,11 +1276,7 @@ public class SwfService implements Resettable {
|
||||
.attr("reason", reason)
|
||||
.attr("details", details)
|
||||
.attr("result", result);
|
||||
if (hasNothingPending(execution)) {
|
||||
scheduleDecisionTask(execution);
|
||||
} else {
|
||||
execution.setDecisionNeeded(true);
|
||||
}
|
||||
scheduleDecisionTaskIfIdle(execution);
|
||||
executionStore.put(pending.executionKey(), execution);
|
||||
}
|
||||
}
|
||||
@@ -1897,13 +1894,6 @@ public class SwfService implements Resettable {
|
||||
.isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
* True when nothing is pending, so the decider gets another decision task rather than
|
||||
* an execution stalled with no outstanding work and no scheduled decision.
|
||||
*/
|
||||
private boolean hasNothingPending(SwfWorkflowExecution execution) {
|
||||
return !hasOpenWork(execution);
|
||||
}
|
||||
|
||||
public int openActivityCount(SwfWorkflowExecution execution) {
|
||||
return (int) execution.getActivities().values().stream().filter(SwfActivityTask::isOpen).count();
|
||||
|
||||
Reference in new issue
Block a user