transfer_queue_standby_task_executor.go ×8

Frontier kind: Code frontier

unlabeled · c_3332bbd30c9b

2 tests · 8287 LOC · 249 files · introduces 0 tests · 65 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges65 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1646 ranges8287 lines · 249 files · Browse complete extent
All tests (intent)
2 testsBrowse complete intent

Neighbourhood graph

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.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

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.

Introduced code

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.

go.temporal.io/server/service/history/transfer_queue_standby_task_executor.go 50 introduced LOC · 8 ranges

Open complete file

97 case *tasks.SignalExecutionTask:
98 err = t.processSignalExecution(ctx, task)
99 > case *tasks.StartChildExecutionTask: transfer_queue_standby_task_executor.go
100 > err = t.processStartChildExecution(ctx, task)
101 case *tasks.ResetWorkflowTask:
102 // no reset needed for standby
468 ctx context.Context,
469 transferTask *tasks.StartChildExecutionTask,
471 > processTaskIfClosed := true
472 > actionFn := func(ctx context.Context, wfContext historyi.WorkflowContext, mutableState historyi.MutableState, release historyi.ReleaseWorkflowContextFunc) (any, error) {
473 > childWorkflowInfo, ok := mutableState.GetChildExecutionInfo(transferTask.InitiatedEventID)
474 > if !ok {
475 return nil, nil
476 }
477
478 > err := CheckTaskVersion(t.shardContext, t.logger, mutableState.GetNamespaceEntry(), childWorkflowInfo.Version, transferTask.Version, transferTask) transfer_queue_standby_task_executor.go
479 > if err != nil {
480 return nil, err
481 }
482
483 > workflowClosed := !mutableState.IsWorkflowExecutionRunning() transfer_queue_standby_task_executor.go
484 > childStarted := childWorkflowInfo.StartedEventId != common.EmptyEventID
485 > childAbandon := childWorkflowInfo.ParentClosePolicy == enumspb.PARENT_CLOSE_POLICY_ABANDON
486 >
487 > // Copy needed values from childWorkflowInfo before releasing mutable state
488 > childTargetNamespaceID := childWorkflowInfo.NamespaceId
489 > childTargetNamespaceName := namespace.Name(childWorkflowInfo.Namespace)
490 > childStartedWorkflowID := childWorkflowInfo.StartedWorkflowId
491 > childStartedRunID := childWorkflowInfo.StartedRunId
492 > childClock := childWorkflowInfo.Clock
493 >
494 > // no need for mutable state anymore, release workflow lock
495 > release(nil)
496 >
497 > if workflowClosed && (!childStarted || !childAbandon) {
498 // NOTE: ideally for workflowClosed, child not started, parent close policy is abandon case,
499 // we should continue to start the child workflow in active cluster, so standby logic also need to
519 }
520
521 > _, err = t.historyRawClient.VerifyFirstWorkflowTaskScheduled(ctx, &historyservice.VerifyFirstWorkflowTaskScheduledRequest{ transfer_queue_standby_task_executor.go
522 > NamespaceId: childTargetNamespaceID,
523 > WorkflowExecution: &commonpb.WorkflowExecution{
524 > WorkflowId: childStartedWorkflowID,
525 > RunId: childStartedRunID,
526 > },
527 > Clock: childClock,
528 > })
529 > switch err.(type) {
530 > case nil, *serviceerror.NamespaceNotFound, *serviceerror.Unimplemented:
531 > // Case 1: Target workflow is in the desired state.
532 > return nil, nil
533 case *serviceerror.NotFound, *serviceerror.WorkflowNotReady:
534 // Case 2: Target workflow is not in the desired state.
546 }
547
548 > return t.processTransfer( transfer_queue_standby_task_executor.go
549 > ctx,
550 > processTaskIfClosed,
551 > transferTask,
552 > actionFn,
553 > getStandbyPostActionFn(
554 > transferTask,
555 > t.getCurrentTime,
556 > t.config.StandbyTaskMissingEventsDiscardDelay(transferTask.GetType()),
557 > t.checkExecutionStillExistsOnSourceBeforeDiscard,
558 > ),
559 > )
560 }
561
go.temporal.io/server/api/historyservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

1565
1566 // VerifyFirstWorkflowTaskScheduled mocks base method.
1567 > func (m *MockHistoryServiceClient) VerifyFirstWorkflowTaskScheduled(ctx context.Context, in *historyservice.VerifyFirstWorkflowTaskScheduledRequest, opts ...grpc.CallOption) (*historyservice.VerifyFirstWorkflowTaskScheduledResponse, error) { service_grpc.pb.mock.go
1568 > m.ctrl.T.Helper()
1569 > varargs := []any{ctx, in}
1570 > for _, a := range opts {
1571 varargs = append(varargs, a)
1572 }
1573 > ret := m.ctrl.Call(m, "VerifyFirstWorkflowTaskScheduled", varargs...) service_grpc.pb.mock.go
1574 > ret0, _ := ret[0].(*historyservice.VerifyFirstWorkflowTaskScheduledResponse)
1575 > ret1, _ := ret[1].(error)
1576 > return ret0, ret1
1577 }
1578
1579 // VerifyFirstWorkflowTaskScheduled indicates an expected call of VerifyFirstWorkflowTaskScheduled.
1580 > func (mr *MockHistoryServiceClientMockRecorder) VerifyFirstWorkflowTaskScheduled(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
1581 > mr.mock.ctrl.T.Helper()
1582 > varargs := append([]any{ctx, in}, opts...)
1583 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyFirstWorkflowTaskScheduled", reflect.TypeOf((*MockHistoryServiceClient)(nil).VerifyFirstWorkflowTaskScheduled), varargs...)
1584 > }
1585
1586 // MockHistoryService_StreamWorkflowReplicationMessagesClient is a mock of HistoryService_StreamWorkflowReplicationMessagesClient interface.
go.temporal.io/server/service/history/queues/metrics.go 2 introduced LOC · 1 range

Open complete file

72 case *tasks.SignalExecutionTask:
73 return metrics.TaskTypeTransferStandbyTaskSignalExecution
74 > case *tasks.StartChildExecutionTask: metrics.go
75 > return metrics.TaskTypeTransferStandbyTaskStartChildExecution
76 case *tasks.ResetWorkflowTask:
77 return metrics.TaskTypeTransferStandbyTaskResetWorkflow