for _, item := range resp.Items {
if !s.executor.Submit(s.newTask(item)) {
return
}
Frontier kind: Code frontier
unlabeled · c_fa6dfa0f1b98
5 tests · 3074 LOC · 149 files · introduces 0 tests · 82 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/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/circuitbreaker/TestTSCBWithDynamicSettingsgo.temporal.io/server/common/dynamicconfig/TestDeepCopy_OtherReferenceTypes_Nilgo.temporal.io/server/service/matching/configs/TestQuotasSuite/TestAPIPrioritiesOrderedgo.temporal.io/server/service/matching/configs/TestQuotasSuite/TestAPIToPriorityMappingEvery 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: 82 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
for _, item := range resp.Items {
if !s.executor.Submit(s.newTask(item)) {
return
}
// process is a callback function that gets invoked from within the executor.Run() method
func (s *Scavenger) process(key *p.TaskQueueKey, state *taskQueueState) executor.TaskStatus {
scavenger.go
return s.deleteHandler(key, state)
}
func (s *Scavenger) awaitExecutor() {
outstanding := s.executor.TaskCount()
for outstanding > 0 {
select {
case <-timer.C:
outstanding = s.executor.TaskCount()
metrics.TaskQueueOutstandingCount.With(s.metricsHandler).Record(float64(outstanding))
case <-s.stopC:
timer.Stop()
// newTask returns a new instance of an executable task which will process a single task queue
return &executorTask{
TaskQueueKey: p.TaskQueueKey{
NamespaceID: info.Data.GetNamespaceId(),
TaskQueueName: info.Data.Name,
TaskQueueType: info.Data.TaskType,
},
taskQueueState: taskQueueState{
rangeID: info.RangeID,
lastUpdated: info.Data.LastUpdateTime.AsTime(),
},
scvg: s,
}
}
// Run runs the task
return t.scvg.process(&t.TaskQueueKey, &t.taskQueueState)
}
// - If the number of tasks retrieved is less than batchSize, there are no more tasks in the task queue
// Try deleting the task queue if its idle
func (s *Scavenger) deleteHandler(key *p.TaskQueueKey, state *taskQueueState) handlerStatus {
handler.go
var err error
var nProcessed, nDeleted int
defer func() { s.deleteHandlerLog(key, state, nProcessed, nDeleted, err) }()
resp, err1 := s.getTasks(s.lifecycleCtx, key, taskBatchSize)
if err1 != nil {
err = err1
return handlerStatusErr
}
if nTasks == 0 {
s.tryDeleteTaskQueue(key, state)
return handlerStatusDone
}
nProcessed++
if !matching.IsTaskExpired(task) {
return handlerStatusDone
}
}
func (s *Scavenger) deleteHandlerLog(key *p.TaskQueueKey, state *taskQueueState, nProcessed int, nDeleted int, err error) {
handler.go
atomic.AddInt64(&s.stats.task.nDeleted, int64(nDeleted))
atomic.AddInt64(&s.stats.task.nProcessed, int64(nProcessed))
if err != nil {
s.logger.Error("scavenger.deleteHandler processed.",
tag.Error(err), tag.WorkflowNamespaceID(key.NamespaceID), tag.WorkflowTaskQueueName(key.TaskQueueName), tag.WorkflowTaskQueueType(key.TaskQueueType), tag.NumberProcessed(nProcessed), tag.NumberDeleted(nDeleted))
return
}
s.logger.Info("scavenger.deleteHandler processed.",
tag.WorkflowNamespaceID(key.NamespaceID), tag.WorkflowTaskQueueName(key.TaskQueueName), tag.WorkflowTaskQueueType(key.TaskQueueType), tag.NumberProcessed(nProcessed), tag.NumberDeleted(nDeleted))
}
}
// CompleteTasksLessThan indicates an expected call of CompleteTasksLessThan.
func (mr *MockTaskManagerMockRecorder) CompleteTasksLessThan(ctx, request any) *gomock.Call {
data_interfaces_mock.go
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompleteTasksLessThan", reflect.TypeOf((*MockTaskManager)(nil).CompleteTasksLessThan), ctx, request)
}
// CountTaskQueuesByBuildId mocks base method.
// DeleteTaskQueue indicates an expected call of DeleteTaskQueue.
func (mr *MockTaskManagerMockRecorder) DeleteTaskQueue(ctx, request any) *gomock.Call {
data_interfaces_mock.go
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTaskQueue", reflect.TypeOf((*MockTaskManager)(nil).DeleteTaskQueue), ctx, request)
}
// GetName mocks base method.
// GetTasks mocks base method.
func (m *MockTaskManager) GetTasks(ctx context.Context, request *GetTasksRequest) (*GetTasksResponse, error) {
data_interfaces_mock.go
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTasks", ctx, request)
ret0, _ := ret[0].(*GetTasksResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetTasks indicates an expected call of GetTasks.
func (mr *MockTaskManagerMockRecorder) GetTasks(ctx, request any) *gomock.Call {
data_interfaces_mock.go
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTasks", reflect.TypeOf((*MockTaskManager)(nil).GetTasks), ctx, request)
}
// ListTaskQueue mocks base method.
key *p.TaskQueueKey,
batchSize int,
var err error
var resp *p.GetTasksResponse
err = s.retryForever(func() error {
resp, err = s.db.GetTasks(ctx, &p.GetTasksRequest{
NamespaceID: key.NamespaceID,
TaskQueue: key.TaskQueueName,
TaskType: key.TaskQueueType,
InclusiveMinTaskID: 0, // get the first N tasks sorted by taskID
ExclusiveMaxTaskID: math.MaxInt64,
PageSize: batchSize,
})
return err
})
return resp, err
}