}
if response != nil {
mutations = append(mutations, response.workflowTaskResponseMutation)
}
postActions = append(postActions, response.commandPostAction)
}
Frontier kind: Code frontier
unlabeled · c_c1791fbed431
11 tests · 8775 LOC · 234 files · introduces 0 tests · 66 LOC · 2 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/rpc/interceptor/TestMethodToPatternMappinggo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestFrontendAPIMetricsgo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestHistoryAPIMetricsgo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestMatchingAPIMetricsgo.temporal.io/server/common/retrypolicy/TestEnsureRetryPolicyDefaults/default_fields_are_set_go.temporal.io/server/common/retrypolicy/TestEnsureRetryPolicyDefaults/empty_policy_has_non-zero_defaultsgo.temporal.io/server/common/retrypolicy/TestEnsureRetryPolicyDefaults/non-retryable_errors_are_setgo.temporal.io/server/common/future/TestFutureSuite/TestGetWhenContextCanceledgo.temporal.io/server/common/future/TestFutureSuite/TestSetGetReady_Sequentialgo.temporal.io/server/common/future/TestFutureSuite/TestSetReadyGet_Parallelgo.temporal.io/server/common/future/TestFutureSuite/TestSetReadyGet_Sequentialgo.temporal.io/server/common/primitives/TestCheckInternalTaskQueueForUserNsAllowed/Child_is_not_internal,_parent_is_empty_-_allowed,_this_method_logic_doesn't_check_for_empty_stringgo.temporal.io/server/common/primitives/TestCheckInternalTaskQueueForUserNsAllowed/Child_is_not_internal,_parent_is_internal_-_allowedgo.temporal.io/server/common/primitives/TestCheckInternalTaskQueueForUserNsAllowed/Child_is_user_task_queue,_parent_is_user_task_queue_-_allowedEvery 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.
2 files ranked by introduced lines: 66 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
}
if response != nil {
mutations = append(mutations, response.workflowTaskResponseMutation)
}
postActions = append(postActions, response.commandPostAction)
}
// all the way down but it requires a bigger refactor of the mutable state interface.
switch command.GetCommandType() {
historyEvent, response, err = handler.handleCommandScheduleActivity(ctx, command.GetScheduleActivityTaskCommandAttributes())
case enumspb.COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION:
_ context.Context,
attr *commandpb.ScheduleActivityTaskCommandAttributes,
) (*historypb.HistoryEvent, *handleCommandResponse, error) {
workflow_task_completed_handler.go
executionInfo := handler.mutableState.GetExecutionInfo()
namespaceID := namespace.ID(executionInfo.NamespaceId)
// TODO(fairness): remove this again once the SDK allows setting the fairness key
const fairnessKeyPrefix = "x-temporal-internal-fairness-key["
if after, ok := strings.CutPrefix(attr.GetActivityId(), fairnessKeyPrefix); ok {
if before, _, ok0 := strings.Cut(after, "]"); ok0 {
keyAndWeight := before
}
func() (enumspb.WorkflowTaskFailedCause, error) {
return handler.attrValidator.ValidateActivityScheduleAttributes(
namespaceID,
attr,
executionInfo.WorkflowRunTimeout,
executionInfo.TaskQueue,
)
},
); err != nil || handler.stopProcessing {
return nil, nil, err
}
// TODO: this is supported in new versioning [cleanup-old-wv]
if attr.UseWorkflowBuildId && attr.TaskQueue.GetName() != "" && attr.TaskQueue.Name != handler.mutableState.GetExecutionInfo().TaskQueue {
err := serviceerror.NewInvalidArgument("Activity with UseCompatibleVersion cannot run on different task queue.")
return nil, nil, handler.failWorkflowTask(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES, err)
}
metricsHandler := handler.metricsHandler.WithTags(metrics.HeaderCallsiteTag("ScheduleActivityTaskCommand"))
workflow_task_completed_handler.go
metrics.HeaderSize.With(metricsHandler).Record(int64(attr.GetHeader().Size()))
if err := handler.sizeLimitChecker.checkIfPayloadSizeExceedsLimit(
metrics.CommandTypeTag(enumspb.COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK.String()),
attr.GetInput().Size(),
"ScheduleActivityTaskCommandAttributes.Input exceeds size limit.",
); err != nil {
return nil, nil, handler.terminateWorkflow(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES, err)
}
if err := handler.sizeLimitChecker.checkIfNumPendingActivitiesExceedsLimit(); err != nil {
workflow_task_completed_handler.go
return nil, nil, handler.failWorkflowTask(enumspb.WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED, err)
}
namespace := handler.mutableState.GetNamespaceEntry().Name().String()
// TODO: versioning 3 allows eager activity dispatch for both pinned and unpinned workflows, no
// special consideration is need. Remove the versioning logic from here. [cleanup-old-wv]
oldVersioningUsed := handler.mutableState.GetMostRecentWorkerVersionStamp().GetUseVersioning() &&
// for V3 versioning it's ok to dispatch eager activities
handler.mutableState.GetEffectiveVersioningBehavior() == enumspb.VERSIONING_BEHAVIOR_UNSPECIFIED
newVersioningUsed := handler.mutableState.GetExecutionInfo().GetAssignedBuildId() != ""
versioningUsed := oldVersioningUsed || newVersioningUsed
// Enable eager activity start if dynamic config enables it and either 1. workflow doesn't use versioning,
// or 2. workflow uses versioning and activity intends to use a compatible version (since a
// worker is obviously compatible with itself and we are okay dispatching an eager task knowing that there may be a
// newer "default" compatible version).
// Note that if `UseWorkflowBuildId` is false, it implies that the activity should run on the "default" version
// for the task queue.
eagerStartActivity := attr.RequestEagerExecution && handler.config.EnableActivityEagerExecution(namespace) &&
(!versioningUsed || attr.UseWorkflowBuildId)
// if the workflow is paused, we bypass activity task generation and also prevent eager activity execution.
bypassActivityTaskGeneration := eagerStartActivity
if handler.mutableState.GetExecutionState().Status == enumspb.WORKFLOW_EXECUTION_STATUS_PAUSED {
bypassActivityTaskGeneration = true
eagerStartActivity = false
}
event, _, err := handler.mutableState.AddActivityTaskScheduledEvent(
workflow_task_completed_handler.go
handler.workflowTaskCompletedID,
attr,
bypassActivityTaskGeneration,
)
if err != nil {
return nil, nil, handler.failWorkflowTaskOnInvalidArgument(enumspb.WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID, err)
}
return event, &handleCommandResponse{}, nil
}
}
if x != nil {
return x.AssignedBuildId
}
return ""
}