From 84ac46a462036d1a40f3fee07d1ff6137ee1d657 Mon Sep 17 00:00:00 2001 From: Yu Xia Date: Tue, 24 Aug 2021 10:44:17 -0700 Subject: [PATCH] Checking get workflow history when sticky decision task --- .../cadence/internal/replay/ReplayDecisionTaskHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/uber/cadence/internal/replay/ReplayDecisionTaskHandler.java b/src/main/java/com/uber/cadence/internal/replay/ReplayDecisionTaskHandler.java index 2ffaaab41..0afa4848f 100644 --- a/src/main/java/com/uber/cadence/internal/replay/ReplayDecisionTaskHandler.java +++ b/src/main/java/com/uber/cadence/internal/replay/ReplayDecisionTaskHandler.java @@ -274,6 +274,9 @@ private Decider createDecider(PollForDecisionTaskResponse decisionTask) throws E .setExecution(decisionTask.getWorkflowExecution()); GetWorkflowExecutionHistoryResponse getHistoryResponse = service.GetWorkflowExecutionHistory(getHistoryRequest); + if (getHistoryResponse.getHistory().getEventsSize() == 0) { + throw new RuntimeException("Failed to get workflow execution history for replay"); + } decisionTask.setHistory(getHistoryResponse.getHistory()); decisionTask.setNextPageToken(getHistoryResponse.getNextPageToken()); }