task_executor.go ×4

Frontier kind: Code frontier

unlabeled · c_78cbf4f5fa5c

2 tests · 4222 LOC · 186 files · introduces 0 tests · 55 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges55 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
619 ranges4222 lines · 186 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.

2 files ranked by introduced lines: 55 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/replication/task_executor.go 42 introduced LOC · 4 ranges

Open complete file

86 case enumsspb.REPLICATION_TASK_TYPE_SYNC_SHARD_STATUS_TASK:
87 // Shard status will be sent as part of the Replication message without kafka
88 > case enumsspb.REPLICATION_TASK_TYPE_SYNC_ACTIVITY_TASK: task_executor.go
89 > err = e.handleActivityTask(ctx, replicationTask, forceApply)
90 case enumsspb.REPLICATION_TASK_TYPE_HISTORY_METADATA_TASK:
91 // Without kafka we should not have size limits so we don't necessary need this in the new replication scheme.
107 task *replicationspb.ReplicationTask,
108 forceApply bool,
109 > ) error { task_executor.go
110 >
111 > attr := task.GetSyncActivityTaskAttributes()
112 > doContinue, err := e.filterTask(namespace.ID(attr.GetNamespaceId()), attr.WorkflowId, forceApply)
113 > if err != nil || !doContinue {
114 return err
115 }
116
117 > startTime := time.Now().UTC() task_executor.go
118 > defer func() {
119 > metrics.ServiceLatency.With(e.metricsHandler).Record(
120 > time.Since(startTime),
121 > metrics.OperationTag(metrics.SyncActivityTaskScope),
122 > metrics.NamespaceTag(attr.GetNamespaceId()),
123 > )
124 > }()
125
126 > request := &historyservice.SyncActivityRequest{ task_executor.go
127 > NamespaceId: attr.NamespaceId,
128 > WorkflowId: attr.WorkflowId,
129 > RunId: attr.RunId,
130 > Version: attr.Version,
131 > ScheduledEventId: attr.ScheduledEventId,
132 > ScheduledTime: attr.ScheduledTime,
133 > StartedEventId: attr.StartedEventId,
134 > StartVersion: attr.StartVersion,
135 > StartedTime: attr.StartedTime,
136 > LastHeartbeatTime: attr.LastHeartbeatTime,
137 > Details: attr.Details,
138 > Attempt: attr.Attempt,
139 > LastFailure: attr.LastFailure,
140 > LastWorkerIdentity: attr.LastWorkerIdentity,
141 > LastStartedBuildId: attr.LastStartedBuildId,
142 > LastStartedRedirectCounter: attr.LastStartedRedirectCounter,
143 > VersionHistory: attr.GetVersionHistory(),
144 > }
145 > namespaceName, _ := e.namespaceRegistry.GetNamespaceName(namespace.ID(attr.NamespaceId))
146 > ctx, cancel := e.newTaskContext(ctx, namespaceName)
147 > defer cancel()
148 >
149 > // This might be extra cost if the workflow belongs to local shard.
150 > // Add a wrapper of the history client to call history engine directly if it becomes an issue.
151 > _, err = e.shardContext.GetHistoryClient().SyncActivity(ctx, request)
152 > switch retryErr := err.(type) {
153 case nil:
154 return nil
go.temporal.io/server/api/historyservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

1365
1366 // SyncActivity mocks base method.
1367 > func (m *MockHistoryServiceClient) SyncActivity(ctx context.Context, in *historyservice.SyncActivityRequest, opts ...grpc.CallOption) (*historyservice.SyncActivityResponse, error) { service_grpc.pb.mock.go
1368 > m.ctrl.T.Helper()
1369 > varargs := []any{ctx, in}
1370 > for _, a := range opts {
1371 varargs = append(varargs, a)
1372 }
1373 > ret := m.ctrl.Call(m, "SyncActivity", varargs...) service_grpc.pb.mock.go
1374 > ret0, _ := ret[0].(*historyservice.SyncActivityResponse)
1375 > ret1, _ := ret[1].(error)
1376 > return ret0, ret1
1377 }
1378
1379 // SyncActivity indicates an expected call of SyncActivity.
1380 > func (mr *MockHistoryServiceClientMockRecorder) SyncActivity(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
1381 > mr.mock.ctrl.T.Helper()
1382 > varargs := append([]any{ctx, in}, opts...)
1383 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncActivity", reflect.TypeOf((*MockHistoryServiceClient)(nil).SyncActivity), varargs...)
1384 > }
1385
1386 // SyncShardStatus mocks base method.