return nil
}
// Initialize chasm tree once for new workflows.
// Using context.Background() because this is done outside an actual request context and the
Frontier kind: Code frontier
unlabeled · c_4d4df420ea2a
16 tests · 8038 LOC · 247 files · introduces 0 tests · 57 LOC · 4 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_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/service/history/historybuilder/TestHistoryBuilder_HasBufferEvents/when_there_are_no_event_in_any_buffer_HasBufferEvents_should_produce_falsego.temporal.io/server/service/history/historybuilder/TestHistoryBuilder_HasBufferEvents/when_there_is_event_in_dbBuffer_HasBufferEvents_should_be_trueEvery 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.
4 files ranked by introduced lines: 57 introduced LOC across 18 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
return nil
}
// Initialize chasm tree once for new workflows.
// Using context.Background() because this is done outside an actual request context and the
}
return ms.addCompletionCallbacksHsm(event, requestID, completionCallbacks)
mutable_state_impl.go
}
requestID string,
completionCallbacks []*commonpb.Callback,
coll := callbacks.MachineCollection(ms.HSM())
maxCallbacksPerWorkflow := ms.config.MaxCallbacksPerWorkflow(ms.GetNamespaceEntry().Name().String())
if len(completionCallbacks)+coll.Size() > maxCallbacksPerWorkflow {
return serviceerror.NewFailedPreconditionf(
"cannot attach more than %d callbacks to a workflow (%d callbacks already attached)",
)
}
persistenceCB := &persistencespb.Callback{
Links: cb.GetLinks(),
}
switch variant := cb.Variant.(type) {
case *commonpb.Callback_Nexus_:
persistenceCB.Variant = &persistencespb.Callback_Nexus_{
Nexus: &persistencespb.Callback_Nexus{
Url: variant.Nexus.GetUrl(),
Header: variant.Nexus.GetHeader(),
},
}
default:
return serviceerror.NewInvalidArgumentf("unknown callback variant: %T", cb.Variant)
}
machine := callbacks.NewCallback(requestID, event.EventTime, callbacks.NewWorkflowClosedTrigger(), persistenceCB)
mutable_state_impl.go
id := ""
// This is for backwards compatibility: callbacks were initially only attached when the workflow
// execution started, but now they can be attached while the workflow is running.
if event.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED {
// Use the start event version and ID as part of the callback ID to ensure that callbacks have unique
// IDs that are deterministically created across clusters.
id = fmt.Sprintf("%d-%d-%d", event.GetVersion(), event.GetEventId(), idx)
} else {
id = fmt.Sprintf("cb-%s-%d", requestID, idx)
}
return err
}
}
}
coll := callbacks.MachineCollection(ms.HSM())
for _, node := range coll.List() {
if err != nil {
return err
}
// Only try to trigger "WorkflowClosed" callbacks.
if _, ok := cb.Trigger.Variant.(*persistencespb.CallbackInfo_Trigger_WorkflowClosed); !ok {
mutable_state_impl.go
continue
}
err = coll.Transition(node.Key.ID, func(cb callbacks.Callback) (hsm.TransitionOutput, error) {
mutable_state_impl.go
return callbacks.TransitionScheduled.Apply(cb, callbacks.EventScheduled{})
})
if err != nil {
return err
}
// For those nodes, we need to make sure their states will be synced as well.
// So when clearing buffered events, generate another SyncHSM task.
return []tasks.Task{
&tasks.SyncHSMTask{
}
case historyi.TransactionPolicyPassive:
return emptyTasks
}
func StateMachineTask(smRegistry *hsm.Registry, task tasks.Task) (hsm.Ref, hsm.Task, error) {
outbound_queue_factory.go
cbt, ok := task.(*tasks.StateMachineOutboundTask)
if !ok {
return hsm.Ref{}, nil, queueserrors.NewUnprocessableTaskError("unknown task type")
}
if !ok {
return hsm.Ref{},
nil,
)
}
smt, err := def.Deserialize(cbt.Info.Data, hsm.TaskAttributes{Destination: cbt.Destination})
outbound_queue_factory.go
if err != nil {
return hsm.Ref{},
nil,
)
}
WorkflowKey: taskWorkflowKey(task),
StateMachineRef: cbt.Info.Ref,
TaskID: task.GetTaskID(),
Validate: smt.Validate,
}, smt, nil
}
type InvocationTaskSerializer struct{}
func (InvocationTaskSerializer) Deserialize(data []byte, attrs hsm.TaskAttributes) (hsm.Task, error) {
tasks.go
return InvocationTask{destination: attrs.Destination}, nil
}
func (InvocationTaskSerializer) Serialize(hsm.Task) ([]byte, error) {
var _ HasOutboundTaskGroup = &StateMachineTask{}
return t.TaskID
}
func (t *StateMachineTask) SetTaskID(id int64) {