From a0cae6a305fe2b7edaa299ceb2fbf3c1b6b6a1d4 Mon Sep 17 00:00:00 2001 From: Yimin Chen Date: Tue, 12 Dec 2017 10:09:55 -0800 Subject: [PATCH] check if workflow is closed when processing sticky timeout timer --- service/history/timerQueueProcessor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/history/timerQueueProcessor.go b/service/history/timerQueueProcessor.go index 02765c829a0..9fc0fe887ea 100644 --- a/service/history/timerQueueProcessor.go +++ b/service/history/timerQueueProcessor.go @@ -783,8 +783,8 @@ Update_History_Loop: t.metricsClient.IncCounter(metrics.TimerTaskDecisionTimeoutScope, metrics.ScheduleToStartTimeoutCounter) // decision schedule to start timeout only apply to sticky decision // check if scheduled decision still pending and not started yet - if isPending && di.Attempt == task.ScheduleAttempt && di.StartedID == emptyEventID && - msBuilder.isStickyTaskListEnabled() { + if isPending && di.Attempt == task.ScheduleAttempt && msBuilder.isWorkflowExecutionRunning() && + di.StartedID == emptyEventID && msBuilder.isStickyTaskListEnabled() { timeoutEvent := msBuilder.AddDecisionTaskScheduleToStartTimeoutEvent(scheduleID) if timeoutEvent == nil { // Unable to add DecisionTaskTimedout event to history