未知的 DecisionId [type=ACTIVITY, id=26], AWS SWF 决策错误

Unknown DecisionId [type=ACTIVITY, id=26], AWS SWF Decision error

我一直间歇性地遇到这个问题,两周一次。据我观察,每次出现此问题时,都是由于 activity Id 26。我看到 activity id 26 已成功完成。不确定为什么决策任务因 activity 成功完成而失败。

"eventTimestamp": 1500668941.164,
"eventType": "WorkflowExecutionFailed",
"eventId": 866, "workflowExecutionFailedEventAttributes":

"details":
"java.lang.IllegalArgumentException: Unknown DecisionId [type=ACTIVITY, id=26].
The possible causes are non-deterministic workflow definition code or incompatible change in the workflow definition.

at: com.amazonaws.services.simpleworkflow.flow.worker.DecisionsHelper.getDecision(DecisionsHelper.java:613)
com.amazonaws.services.simpleworkflow.flow.worker.DecisionsHelper.handleActivityTaskScheduled(DecisionsHelper.java:171)
at: com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider.processEvent(AsyncDecider.java:267) com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider.decide(AsyncDecider.java:515)
at: com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler.handleDecisionTask(AsyncDecisionTaskHandler.java:50)
at com.amazonaws.services.simpleworkflow.flow.worker.DecisionTaskPoller.pollAndProcessSingleTask(DecisionTaskPoller.java:201)
at com.amazonaws.services.simpleworkflow.flow.worker.GenericWorker$PollServiceTask.run(GenericWorker.java:94)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)",

"decisionTaskCompletedEventId": 865,
"reason": "Unknown DecisionId [type=ACTIVITY, id=26].
The possible causes are non-deterministic workflow definition code or incompatible change in the workflow definition."

如有任何帮助,我们将不胜感激。

AWS Flow Framework 使用重放来重建工作流状态。它要求工作流代码是确定性的。 IE。当重播历史时,它会进入完全相同的状态。有多种方法可以打破决定论。最常见的是工作流代码(或配置)更改,而某些工作流 运行 或使用系统时间而不是框架提供的 Clock 对象。 您是否进行过任何时间计算或您最近是否更改过工作流程代码?

有关在不破坏 运行 工作流程的情况下更新工作流程代码的各种方法,请参阅 Making Changes to Decider Code: Versioning and Feature Flags