Use proper context deadline when pushing activity to matching
@@ -441,17 +441,19 @@ func (t *timerQueueActiveTaskExecutor) executeActivityRetryTimerTask(
Name: activityInfo.TaskQueue,
Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
}
- scheduleToStartTimeout := activityInfo.ScheduleToStartTimeout
+ scheduleToStartTimeout := timestamp.DurationValue(activityInfo.ScheduleToStartTimeout)
release(nil) // release earlier as we don't need the lock anymore
- _, retError = t.shard.GetService().GetMatchingClient().AddActivityTask(context.Background(), &matchingservice.AddActivityTaskRequest{
+ ctx, cancel := context.WithTimeout(context.Background(), transferActiveTaskDefaultTimeout)
+ defer cancel()
+ _, retError = t.shard.GetService().GetMatchingClient().AddActivityTask(ctx, &matchingservice.AddActivityTaskRequest{
NamespaceId: targetNamespaceID,
SourceNamespaceId: namespaceID,
Execution: execution,
TaskQueue: taskQueue,
ScheduleId: scheduledID,
- ScheduleToStartTimeout: scheduleToStartTimeout,
+ ScheduleToStartTimeout: timestamp.DurationPtr(scheduleToStartTimeout),
})
return retError
