executors.go ×10

Frontier kind: Code frontier

unlabeled · c_907aad461a63

11 tests · 3279 LOC · 138 files · introduces 0 tests · 33 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges33 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
603 ranges3279 lines · 138 files · Browse complete extent
All tests (intent)
11 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.

1 file ranked by introduced lines: 33 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/components/nexusoperations/executors.go 33 introduced LOC · 10 ranges

Open complete file

717 }
718
719 > callTimeout := e.Config.RequestTimeout(ns.Name().String(), task.EndpointName) executors.go
720 > var timeoutType enumspb.TimeoutType
721 > // Adjust timeout based on remaining operation timeouts.
722 > if args.startToCloseTimeout > 0 {
723 callTimeout = min(callTimeout, args.startToCloseTimeout-time.Since(args.startedTime))
724 timeoutType = enumspb.TIMEOUT_TYPE_START_TO_CLOSE
725 }
726 > if args.scheduleToCloseTimeout > 0 { executors.go
727 callTimeout = min(callTimeout, args.scheduleToCloseTimeout-time.Since(args.scheduledTime))
728 timeoutType = enumspb.TIMEOUT_TYPE_SCHEDULE_TO_CLOSE
729 }
730 > callCtx, cancel := context.WithTimeout(ctx, callTimeout) executors.go
731 > defer cancel()
732 >
733 > // Set this value on the parent context so that our custom HTTP caller can mutate it since we cannot access response headers directly.
734 > callCtx = context.WithValue(callCtx, commonnexus.FailureSourceContextKey, &atomic.Value{})
735 >
736 > var callErr error
737 > var startTime time.Time
738 > if callTimeout < e.Config.MinRequestTimeout(ns.Name().String()) {
739 startTime = time.Now()
740 callErr = &operationTimeoutBelowMinError{timeoutType: timeoutType}
741 > } else if args.endpointName == commonnexus.SystemEndpoint { executors.go
742 startTime = time.Now()
743 callErr = e.cancelOnHistoryService(callCtx, ns, args)
777 callErr = handle.Cancel(callCtx, nexus.CancelOperationOptions{Header: nexus.Header(args.headers)})
778 }
779 > failureSource := failureSourceFromContext(callCtx) executors.go
780 > methodTag := metrics.NexusMethodTag("CancelOperation")
781 > namespaceTag := metrics.NamespaceTag(ns.Name().String())
782 > var destTag metrics.Tag
783 > if endpoint != nil {
784 destTag = metrics.DestinationTag(endpoint.Endpoint.Spec.GetName())
785 > } else { executors.go
786 destTag = metrics.DestinationTag(args.endpointName)
787 }
788 > statusCodeTag := metrics.OutcomeTag(cancelCallOutcomeTag(callCtx, callErr)) executors.go
789 > failureSourceTag := metrics.FailureSourceTag(failureSource)
790 > chasmnexus.OutboundRequestCounter.With(e.MetricsHandler).Record(1, namespaceTag, destTag, methodTag, statusCodeTag, failureSourceTag)
791 > chasmnexus.OutboundRequestLatency.With(e.MetricsHandler).Record(time.Since(startTime), namespaceTag, destTag, methodTag, statusCodeTag, failureSourceTag)
792 >
793 > if callErr != nil {
794 if failureSource == commonnexus.FailureSourceWorker || errors.As(callErr, new(*operationTimeoutBelowMinError)) {
795 e.Logger.Debug("Nexus CancelOperation request failed", tag.Error(callErr))
799 }
800
801 > err = e.saveCancelationResult(ctx, env, ref, callErr, args.scheduledEventID) executors.go
802 >
803 > if callErr != nil && isDestinationDown(callErr) {
804 err = queueserrors.NewDestinationDownError(callErr.Error(), err)
805 }
806
807 > return err executors.go
808 }
809
1000 }
1001
1002 > func cancelCallOutcomeTag(callCtx context.Context, callErr error) string { executors.go
1003 > if callErr != nil {
1004 if errors.Is(callErr, errOpProcessorFailed) {
1005 return "operation-processor-failed"