}
callbackURL, err := buildCallbackURL(e.Config.UseSystemCallbackURL(), e.Config.CallbackURLTemplate(), ns, endpoint)
executors.go
if err != nil {
return fmt.Errorf("failed to build callback URL: %w", err)
}
Frontier kind: Code frontier
unlabeled · c_026d1278ae8a
17 tests · 3346 LOC · 142 files · introduces 0 tests · 70 LOC · 1 file
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.
1 file ranked by introduced lines: 70 introduced LOC across 18 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
}
callbackURL, err := buildCallbackURL(e.Config.UseSystemCallbackURL(), e.Config.CallbackURLTemplate(), ns, endpoint)
executors.go
if err != nil {
return fmt.Errorf("failed to build callback URL: %w", err)
}
// Operation machine has transitioned.
// TODO(bergundy): Remove this before the 1.27 release.
smRef.MachineTransitionCount = 0
// Set ms VT to initial version because workflow may switch to a different branch.
smRef.MutableStateVersionedTransition = smRef.MachineInitialVersionedTransition
token, err := e.CallbackTokenGenerator.Tokenize(&tokenspb.NexusOperationCompletion{
NamespaceId: ref.WorkflowKey.NamespaceID,
WorkflowId: ref.WorkflowKey.WorkflowID,
RunId: ref.WorkflowKey.RunID,
Ref: smRef,
RequestId: args.requestID,
})
if err != nil {
return fmt.Errorf("%w: %w", queueserrors.NewUnprocessableTaskError("failed to generate a callback token"), err)
}
var timeoutType enumspb.TimeoutType
// Adjust timeout based on remaining operation timeouts.
// ScheduleToStart takes precedence over ScheduleToClose since it is already capped by it.
if args.scheduleToStartTimeout > 0 {
callTimeout = min(callTimeout, args.scheduleToStartTimeout-time.Since(args.scheduledTime))
timeoutType = enumspb.TIMEOUT_TYPE_SCHEDULE_TO_START
callTimeout = min(callTimeout, args.scheduleToCloseTimeout-time.Since(args.scheduledTime))
timeoutType = enumspb.TIMEOUT_TYPE_SCHEDULE_TO_CLOSE
// Inform the handler of the operation timeout via header.
// StartToClose takes precedence over ScheduleToClose since it is already capped by it.
if args.startToCloseTimeout > 0 {
opTimeout = args.startToCloseTimeout
}
opTimeout = min(args.scheduleToCloseTimeout-time.Since(args.scheduledTime), opTimeout)
}
if header == nil {
header = make(nexus.Header, 1) // It's most likely that we'll only be setting the new wire format header.
}
// Set the operation timeout header if not already set.
if opTimeoutHeader := header.Get(nexus.HeaderOperationTimeout); opTimeout != maxDuration && opTimeoutHeader == "" {
executors.go
header[nexus.HeaderOperationTimeout] = commonnexus.FormatDuration(opTimeout)
}
// If this request is handled by a newer server that supports Nexus failure serialization, trigger that behavior.
header.Set(nexusrpc.HeaderTemporalNexusFailureSupport, "true")
}
defer cancel()
// Set this value on the parent context so that our custom HTTP caller can mutate it since we cannot access response headers directly.
callCtx = context.WithValue(callCtx, commonnexus.FailureSourceContextKey, &atomic.Value{})
options := nexus.StartOperationOptions{
Header: header,
CallbackURL: callbackURL,
RequestID: args.requestID,
CallbackHeader: nexus.Header{
commonnexus.CallbackTokenHeader: token,
},
Links: []nexus.Link{args.nexusLink},
}
var result *nexusrpc.ClientStartOperationResponse[*commonpb.Payload]
var callErr error
var startTime time.Time
if callTimeout < e.Config.MinRequestTimeout(ns.Name().String()) {
startTime = time.Now()
callErr = &operationTimeoutBelowMinError{timeoutType: timeoutType}
startTime = time.Now()
result, callErr = e.startOnHistoryService(callCtx, ns, args, options)
}
tokenLimit := e.Config.MaxOperationTokenLength(ns.Name().String())
if result.Pending != nil && len(result.Pending.Token) > tokenLimit {
}
}
methodTag := metrics.NexusMethodTag("StartOperation")
namespaceTag := metrics.NamespaceTag(ns.Name().String())
var destTag metrics.Tag
if endpoint != nil {
destTag = metrics.DestinationTag(endpoint.Endpoint.Spec.GetName())
destTag = metrics.DestinationTag(args.endpointName)
}
failureSourceTag := metrics.FailureSourceTag(failureSource)
chasmnexus.OutboundRequestCounter.With(e.MetricsHandler).Record(1, namespaceTag, destTag, methodTag, outcomeTag, failureSourceTag)
chasmnexus.OutboundRequestLatency.With(e.MetricsHandler).Record(time.Since(startTime), namespaceTag, destTag, methodTag, outcomeTag, failureSourceTag)
if callErr != nil {
if failureSource == commonnexus.FailureSourceWorker || errors.As(callErr, new(*operationTimeoutBelowMinError)) {
e.Logger.Debug("Nexus StartOperation request failed", tag.Error(callErr))
}
if callErr != nil && isDestinationDown(callErr) {
err = queueserrors.NewDestinationDownError(callErr.Error(), err)
}
}
}
func startCallOutcomeTag(callCtx context.Context, result *nexusrpc.ClientStartOperationResponse[*commonpb.Payload], callErr error) string {
executors.go
if callErr != nil {
var opTimeoutBelowMinErr *operationTimeoutBelowMinError
if errors.As(callErr, &opTimeoutBelowMinErr) {