// TODO: add error logs
err = nil
err = t.processCloseExecution(ctx, task)
case *tasks.DeleteExecutionTask:
err = t.processDeleteExecutionTask(ctx, task, false)
Frontier kind: Joint frontier
unlabeled · c_006a03fc53b7
1 test · 8614 LOC · 255 files · introduces 1 test · 123 LOC · 5 files
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/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents/When_AddWorkflowExecutionStartedEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_WorkflowFinishEvents/When_AddWorkflowExecutionStartedEvent_go.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents/When_WorkflowTaskCompletedEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_WorkflowFinishEvents/When_WorkflowTaskCompletedEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents/When_CompletedWorkflowEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_WorkflowFinishEvents/When_CompletedWorkflowEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents/When_WorkflowTaskScheduledEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_AssignmentEventId/Adding_batched_event_will_set_event_id_to_next_event_id_allocated_by_HistoryBuildergo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_WorkflowFinishEvents/When_WorkflowTaskScheduledEvent_added_go.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents/When_WorkflowTaskStartedEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_WorkflowFinishEvents/When_WorkflowTaskStartedEvent_added_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/TestMatchingAPIMetricsEvery collected test enters the hierarchy at exactly one concept.
1 test introduced at this concept.
Every collected source range enters the hierarchy at exactly one concept.
5 files ranked by introduced lines: 123 introduced LOC across 18 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
// TODO: add error logs
err = nil
err = t.processCloseExecution(ctx, task)
case *tasks.DeleteExecutionTask:
err = t.processDeleteExecutionTask(ctx, task, false)
ctx context.Context,
transferTask *tasks.CloseExecutionTask,
processTaskIfClosed := true
actionFn := func(ctx context.Context, wfContext historyi.WorkflowContext, mutableState historyi.MutableState, release historyi.ReleaseWorkflowContextFunc) (any, error) {
if mutableState.IsWorkflowExecutionRunning() {
// this can happen if workflow is reset.
return nil, nil
}
closeVersion, err := mutableState.GetCloseVersion()
if err != nil {
return nil, err
}
err = CheckTaskVersion(t.shardContext, t.logger, mutableState.GetNamespaceEntry(), closeVersion, transferTask.Version, transferTask)
transfer_queue_standby_task_executor.go
if err != nil {
return nil, err
}
// verify if parent got the completion event
verifyCompletionRecorded := mutableState.HasParentExecution() && executionInfo.NewExecutionRunId == ""
transfer_queue_standby_task_executor.go
if verifyCompletionRecorded {
// load close event only if needed.
completionEvent, err := mutableState.GetCompletionEvent(ctx)
if err != nil {
return nil, err
}
verifyCompletionRecorded = !ndc.IsTerminatedByResetter(completionEvent)
transfer_queue_standby_task_executor.go
}
now := t.getCurrentTime()
taskTime := transferTask.GetVisibilityTime()
localVerificationTime := taskTime.Add(t.config.MaxLocalParentWorkflowVerificationDuration())
resendParent := now.After(localVerificationTime) && mutableState.IsTransitionHistoryEnabled() && mutableState.CurrentVersionedTransition() != nil
// Copy needed values from executionInfo before releasing mutable state
parentNamespaceID := executionInfo.ParentNamespaceId
parentWorkflowID := executionInfo.ParentWorkflowId
parentRunID := executionInfo.ParentRunId
parentInitiatedID := executionInfo.ParentInitiatedId
parentInitiatedVersion := executionInfo.ParentInitiatedVersion
parentClock := executionInfo.ParentClock
// no need for mutable state anymore, release workflow lock
release(nil)
_, err := t.historyRawClient.VerifyChildExecutionCompletionRecorded(ctx, &historyservice.VerifyChildExecutionCompletionRecordedRequest{
NamespaceId: parentNamespaceID,
ParentExecution: &commonpb.WorkflowExecution{
WorkflowId: parentWorkflowID,
RunId: parentRunID,
},
ChildExecution: &commonpb.WorkflowExecution{
WorkflowId: transferTask.WorkflowID,
RunId: transferTask.RunID,
},
ParentInitiatedId: parentInitiatedID,
ParentInitiatedVersion: parentInitiatedVersion,
Clock: parentClock,
ResendParent: resendParent,
})
switch err.(type) {
case nil, *serviceerror.NamespaceNotFound, *serviceerror.Unimplemented:
// Case 1: Target workflow is in the desired state.
return nil, nil
case *serviceerror.NotFound, *serviceerror.WorkflowNotReady:
// Case 2: Target workflow is not in the desired state.
// Returning a non-nil pointer as postActionInfo here to indicate that verification is not done yet.
return &verifyCompletionRecordedPostActionInfo{
parentWorkflowKey: &definition.WorkflowKey{
NamespaceID: parentNamespaceID,
WorkflowID: parentWorkflowID,
RunID: parentRunID,
},
}, nil
default:
// Case 3: Verification itself failed.
// NOTE: Wrapping the error as a verification error to prevent mutable state from being cleared and reloaded upon retry,
// which is unnecessary as the error is in the target workflow, not this workflow.
return nil, &verificationErr{
msg: recordChildCompletionVerificationFailedMsg,
err: err,
}
}
}
}
ctx,
processTaskIfClosed,
transferTask,
actionFn,
getStandbyPostActionFn(
transferTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsDiscardDelay(transferTask.GetType()),
t.checkParentWorkflowStillExistOnSourceBeforeDiscard,
),
)
}
postActionInfo any,
logger log.Logger,
if postActionInfo == nil {
return nil
}
verifyCompletionInfo, ok := postActionInfo.(*verifyCompletionRecordedPostActionInfo)
transfer_queue_standby_task_executor.go
if !ok || verifyCompletionInfo.parentWorkflowKey == nil {
return standbyTransferTaskPostActionTaskDiscarded(ctx, taskInfo, postActionInfo, logger)
}
ctx,
*verifyCompletionInfo.parentWorkflowKey,
getTaskArchetypeID(taskInfo),
logger,
t.clusterName,
t.clientBean,
t.shardContext.GetNamespaceRegistry(),
t.shardContext.ChasmRegistry(),
) {
return standbyTransferTaskPostActionTaskDiscarded(ctx, taskInfo, nil, logger)
}
return standbyTransferTaskPostActionTaskDiscarded(ctx, taskInfo, postActionInfo, logger)
transfer_queue_standby_task_executor.go
}
// VerifyChildExecutionCompletionRecorded mocks base method.
func (m *MockHistoryServiceClient) VerifyChildExecutionCompletionRecorded(ctx context.Context, in *historyservice.VerifyChildExecutionCompletionRecordedRequest, opts ...grpc.CallOption) (*historyservice.VerifyChildExecutionCompletionRecordedResponse, error) {
service_grpc.pb.mock.go
m.ctrl.T.Helper()
varargs := []any{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "VerifyChildExecutionCompletionRecorded", varargs...)
service_grpc.pb.mock.go
ret0, _ := ret[0].(*historyservice.VerifyChildExecutionCompletionRecordedResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// VerifyChildExecutionCompletionRecorded indicates an expected call of VerifyChildExecutionCompletionRecorded.
func (mr *MockHistoryServiceClientMockRecorder) VerifyChildExecutionCompletionRecorded(ctx, in any, opts ...any) *gomock.Call {
service_grpc.pb.mock.go
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyChildExecutionCompletionRecorded", reflect.TypeOf((*MockHistoryServiceClient)(nil).VerifyChildExecutionCompletionRecorded), varargs...)
}
// VerifyFirstWorkflowTaskScheduled mocks base method.
mi := &file_temporal_server_api_historyservice_v1_request_response_proto_msgTypes[52]
if x != nil {
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
return ms.transitionHistoryEnabled
}
func (ms *MutableStateImpl) StartTransaction(
case *tasks.WorkflowTask:
return metrics.TaskTypeTransferStandbyTaskWorkflowTask
return metrics.TaskTypeTransferStandbyTaskCloseExecution
case *tasks.CancelExecutionTask:
return metrics.TaskTypeTransferStandbyTaskCancelExecution