case *tasks.SignalExecutionTask:
err = t.processSignalExecution(ctx, task)
err = t.processStartChildExecution(ctx, task)
case *tasks.ResetWorkflowTask:
// no reset needed for standby
Frontier kind: Code frontier
unlabeled · c_3332bbd30c9b
2 tests · 8287 LOC · 249 files · introduces 0 tests · 65 LOC · 3 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_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_WorkflowTaskStartedEvent_added_it_will_be_placed_in_memLatestBatchgo.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_AddDifferentEvents_WorkflowFinishEvents/When_WorkflowTaskStartedEvent_added_Every 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.
3 files ranked by introduced lines: 65 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
case *tasks.SignalExecutionTask:
err = t.processSignalExecution(ctx, task)
err = t.processStartChildExecution(ctx, task)
case *tasks.ResetWorkflowTask:
// no reset needed for standby
ctx context.Context,
transferTask *tasks.StartChildExecutionTask,
processTaskIfClosed := true
actionFn := func(ctx context.Context, wfContext historyi.WorkflowContext, mutableState historyi.MutableState, release historyi.ReleaseWorkflowContextFunc) (any, error) {
childWorkflowInfo, ok := mutableState.GetChildExecutionInfo(transferTask.InitiatedEventID)
if !ok {
return nil, nil
}
err := CheckTaskVersion(t.shardContext, t.logger, mutableState.GetNamespaceEntry(), childWorkflowInfo.Version, transferTask.Version, transferTask)
transfer_queue_standby_task_executor.go
if err != nil {
return nil, err
}
workflowClosed := !mutableState.IsWorkflowExecutionRunning()
transfer_queue_standby_task_executor.go
childStarted := childWorkflowInfo.StartedEventId != common.EmptyEventID
childAbandon := childWorkflowInfo.ParentClosePolicy == enumspb.PARENT_CLOSE_POLICY_ABANDON
// Copy needed values from childWorkflowInfo before releasing mutable state
childTargetNamespaceID := childWorkflowInfo.NamespaceId
childTargetNamespaceName := namespace.Name(childWorkflowInfo.Namespace)
childStartedWorkflowID := childWorkflowInfo.StartedWorkflowId
childStartedRunID := childWorkflowInfo.StartedRunId
childClock := childWorkflowInfo.Clock
// no need for mutable state anymore, release workflow lock
release(nil)
if workflowClosed && (!childStarted || !childAbandon) {
// NOTE: ideally for workflowClosed, child not started, parent close policy is abandon case,
// we should continue to start the child workflow in active cluster, so standby logic also need to
}
return &struct{}{}, nil
}
// This is for backward compatibility.
// Old mutable state may not have the target namespace ID set in childWorkflowInfo.
}
_, err = t.historyRawClient.VerifyFirstWorkflowTaskScheduled(ctx, &historyservice.VerifyFirstWorkflowTaskScheduledRequest{
transfer_queue_standby_task_executor.go
NamespaceId: childTargetNamespaceID,
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: childStartedWorkflowID,
RunId: childStartedRunID,
},
Clock: childClock,
})
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.
}
ctx,
processTaskIfClosed,
transferTask,
actionFn,
getStandbyPostActionFn(
transferTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsDiscardDelay(transferTask.GetType()),
t.checkExecutionStillExistsOnSourceBeforeDiscard,
),
)
}
// VerifyFirstWorkflowTaskScheduled mocks base method.
func (m *MockHistoryServiceClient) VerifyFirstWorkflowTaskScheduled(ctx context.Context, in *historyservice.VerifyFirstWorkflowTaskScheduledRequest, opts ...grpc.CallOption) (*historyservice.VerifyFirstWorkflowTaskScheduledResponse, 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, "VerifyFirstWorkflowTaskScheduled", varargs...)
service_grpc.pb.mock.go
ret0, _ := ret[0].(*historyservice.VerifyFirstWorkflowTaskScheduledResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// VerifyFirstWorkflowTaskScheduled indicates an expected call of VerifyFirstWorkflowTaskScheduled.
func (mr *MockHistoryServiceClientMockRecorder) VerifyFirstWorkflowTaskScheduled(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, "VerifyFirstWorkflowTaskScheduled", reflect.TypeOf((*MockHistoryServiceClient)(nil).VerifyFirstWorkflowTaskScheduled), varargs...)
}
// MockHistoryService_StreamWorkflowReplicationMessagesClient is a mock of HistoryService_StreamWorkflowReplicationMessagesClient interface.
case *tasks.SignalExecutionTask:
return metrics.TaskTypeTransferStandbyTaskSignalExecution
return metrics.TaskTypeTransferStandbyTaskStartChildExecution
case *tasks.ResetWorkflowTask:
return metrics.TaskTypeTransferStandbyTaskResetWorkflow