case *tasks.WorkflowTask:
err = t.processWorkflowTask(ctx, task)
err = t.processCloseExecution(ctx, task)
case *tasks.CancelExecutionTask:
err = t.processCancelExecution(ctx, task)
Frontier kind: Code frontier
unlabeled · c_37f40bad493b
18 tests · 7504 LOC · 229 files · introduces 0 tests · 53 LOC · 1 file
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
Every exact file and test below is linked only from the concept that introduces it.
go.temporal.io/server/common/persistence/client/TestQuotasSuite/TestAPITypeCallOriginPriorityOverrideMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestBackgroundTypeAPIPriorityOverrideMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestCallerTypeDefaultPriorityMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestRequestPrioritiesOrderedgo.temporal.io/server/common/rpc/interceptor/TestMethodToPatternMappinggo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestFrontendAPIMetricsgo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestHistoryAPIMetricsgo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestMatchingAPIMetricsgo.temporal.io/server/common/future/TestFutureSuite/TestGetWhenContextCanceledgo.temporal.io/server/common/future/TestFutureSuite/TestSetGetReady_Sequentialgo.temporal.io/server/common/future/TestFutureSuite/TestSetReadyGet_Parallelgo.temporal.io/server/common/future/TestFutureSuite/TestSetReadyGet_SequentialEvery collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
1 file ranked by introduced lines: 53 introduced LOC across 18 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
case *tasks.WorkflowTask:
err = t.processWorkflowTask(ctx, task)
err = t.processCloseExecution(ctx, task)
case *tasks.CancelExecutionTask:
err = t.processCancelExecution(ctx, task)
ctx context.Context,
task *tasks.CloseExecutionTask,
ctx, cancel := context.WithTimeout(ctx, taskTimeout)
defer cancel()
weContext, release, err := getWorkflowExecutionContextForTask(ctx, t.shardContext, t.cache, task)
if err != nil {
return err
}
mutableState, err := loadMutableStateForTransferTask(ctx, t.shardContext, weContext, task, t.metricHandler, t.logger)
transfer_queue_active_task_executor.go
if err != nil {
return err
}
if mutableState == nil || mutableState.IsWorkflowExecutionRunning() {
transfer_queue_active_task_executor.go
return nil
}
// DeleteAfterClose is set to true when this close execution task was generated as part of delete open workflow execution procedure.
// Delete workflow execution is started by user API call and should be done regardless of current workflow version.
closeVersion, err := mutableState.GetCloseVersion()
if err != nil {
return err
}
err = CheckTaskVersion(t.shardContext, t.logger, mutableState.GetNamespaceEntry(), closeVersion, task.Version, task)
transfer_queue_active_task_executor.go
if err != nil {
return err
}
}
WorkflowId: task.GetWorkflowID(),
RunId: task.GetRunID(),
}
executionInfo := mutableState.GetExecutionInfo()
children := copyChildWorkflowInfos(mutableState.GetPendingChildExecutionInfos())
var completionEvent *historypb.HistoryEvent // needed to report close event to parent workflow
replyToParentWorkflow := mutableState.HasParentExecution() && executionInfo.NewExecutionRunId == ""
if replyToParentWorkflow || len(children) > 0 {
// only load close event if needed.
completionEvent, err = mutableState.GetCompletionEvent(ctx)
replyToParentWorkflow = replyToParentWorkflow && !ndc.IsTerminatedByResetter(completionEvent)
}
parentWorkflowID := executionInfo.ParentWorkflowId
parentRunID := executionInfo.ParentRunId
parentInitiatedID := executionInfo.ParentInitiatedId
parentInitiatedVersion := executionInfo.ParentInitiatedVersion
var parentClock *clockspb.VectorClock
if executionInfo.ParentClock != nil {
parentClock = vclock.NewVectorClock(
executionInfo.ParentClock.ClusterId,
}
namespaceName := mutableState.GetNamespaceEntry().Name()
transfer_queue_active_task_executor.go
firstRunID, err := mutableState.GetFirstRunID(ctx)
if err != nil {
return err
}
// Release lock immediately since mutable state is not needed
// and the rest of logic is RPC calls, which can take time.
// Communicate the result to parent execution if this is Child Workflow execution
if replyToParentWorkflow {
_, err := t.historyRawClient.RecordChildExecutionCompleted(ctx, &historyservice.RecordChildExecutionCompletedRequest{
NamespaceId: parentNamespaceID,
// So we need to additionally check the termination reason for this parent to determine if this task was indeed created due to reset or due to normal completion of the WF.
// Also, checking the dynamic config is not strictly safe since by definition it can change at any time. However this reduces the chance of us skipping the parent close policy when we shouldn't.
allowResetWithPendingChildren := t.config.AllowResetWithPendingChildren(namespaceName.String())
transfer_queue_active_task_executor.go
shouldSkipParentClosePolicy := false
isParentTerminatedDueToReset := (completionEvent != nil) && ndc.IsTerminatedByResetter(completionEvent)
if isParentTerminatedDueToReset && executionInfo.GetResetRunId() != "" && allowResetWithPendingChildren {
// TODO (Chetan): update this condition as new reset policies/cases are added.
shouldSkipParentClosePolicy = true // only skip if the parent is reset and we are using the new flow.
}
if err := t.processParentClosePolicy(
ctx,
}
err = t.deleteExecution(
ctx,
func copyChildWorkflowInfos(
input map[int64]*persistencespb.ChildExecutionInfo,
result := make(map[int64]*persistencespb.ChildExecutionInfo)
if input == nil {
return result
}
result[k] = common.CloneProto(v)
}
}