server.go ×4

Frontier kind: Code frontier

unlabeled · c_7ed41429b022

17 tests · 19 LOC · 1 file · introduces 0 tests · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges19 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4 ranges19 lines · 1 file · Browse complete extent
All tests (intent)
17 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.

Introduced files, introduced tests, and structurally relevant concept specializationoperation.go ×2 · 6 introduced LOCoperation.go ×2sync_failed · 0 introduced LOCsync_failedtask_handler_helpers.go ×3 · 6 introduced LOCtask_handler_helpers.go …executors.go ×1 · 4 introduced LOCexecutors.go ×1sync_failed · 0 introduced LOCsync_failedexecutors.go ×1 · 4 introduced LOCexecutors.go ×1transient_error · 0 introduced LOCtransient_errorfailure · 0 introduced LOCfailureexecutors.go ×1 · 2 introduced LOCexecutors.go ×1transient_error · 0 introduced LOCtransient_errorfailure · 0 introduced LOCfailuretask_handler_helpers.go ×2 · 3 introduced LOCtask_handler_helpers.go …executors.go ×2 · 3 introduced LOCexecutors.go ×2failure_converter.go ×1 · 1 introduced LOCfailure_converter.go ×1handle.go ×1 · 5 introduced LOChandle.go ×1nexus_operation_http_handler.go ×3 · 20 introduced LOCnexus_operation_http_han…nexus_operation_http_handler.go ×1 · 2 introduced LOCnexus_operation_http_han…nexus_operation_http_handler.go ×1 · 2 introduced LOCnexus_operation_http_han…nexus_operation_http_handler.go ×4 · 13 introduced LOCnexus_operation_http_han…server.go ×1 · 2 introduced LOCserver.go ×1nexus_operation_http_handler.go ×4 · 22 introduced LOCnexus_operation_http_han…client.go ×1 · 4 introduced LOCclient.go ×1client.go ×4 · 16 introduced LOCclient.go ×4client.go ×1 · 2 introduced LOCclient.go ×1client.go ×4 · 16 introduced LOCclient.go ×4client.go ×1 · 2 introduced LOCclient.go ×1client.go ×1 · 2 introduced LOCclient.go ×1completion.go ×1 · 2 introduced LOCcompletion.go ×1server.go ×1 · 1 introduced LOCserver.go ×1server.go ×1 · 2 introduced LOCserver.go ×1server.go ×1 · 2 introduced LOCserver.go ×1server.go ×1 · 1 introduced LOCserver.go ×1client.go ×3 · 4 introduced LOCclient.go ×3failure_converter.go ×1 · 5 introduced LOCfailure_converter.go ×1client.go ×1 · 3 introduced LOCclient.go ×1server.go ×4 · 7 introduced LOCserver.go ×4TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/chasm/lib/nexusoperation/operation.go · 713 LOCnexusoperation/operation…go.temporal.io/server/chasm/lib/nexusoperation/task_handler_helpers.go · 380 LOCnexusoperation/task_hand…go.temporal.io/server/common/nexus/nexusrpc/client.go · 502 LOCnexusrpc/client.gogo.temporal.io/server/common/nexus/nexusrpc/completion.go · 327 LOCnexusrpc/completion.gogo.temporal.io/server/common/nexus/nexusrpc/failure_converter.go · 213 LOCnexusrpc/failure_convert…go.temporal.io/server/common/nexus/nexusrpc/handle.go · 49 LOCnexusrpc/handle.gogo.temporal.io/server/common/nexus/nexusrpc/server.go · 404 LOCnexusrpc/server.gogo.temporal.io/server/components/nexusoperations/executors.go · 1250 LOCnexusoperations/executor…go.temporal.io/server/service/frontend/nexus_operation_http_handler.go · 319 LOCfrontend/nexus_operation…failure · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestCancellationInvocationTaskHandler_HTTP/failurefailuretransient_error · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestCancellationInvocationTaskHandler_HTTP/transient_errortransient_errorsync_canceled · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/sync_canceledsync_canceledsync_failed · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/sync_failedsync_failedtransient_error · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/transient_errortransient_errorTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…TestBadRequestCompletion · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestBadRequestCompletionTestBadRequestCompletionTestCustomFailureConverter · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestCustomFailureConverterTestCustomFailureConvert…TestHandlerErrorRetryBehavior · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestHandlerErrorRetryBehaviorTestHandlerErrorRetryBeh…TestUnsuccessful · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestUnsuccessfulTestUnsuccessfulfailure · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessCancelationTask/failurefailuretransient_error · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessCancelationTask/transient_errortransient_errorsync_canceled · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/sync_canceledsync_canceledsync_failed · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/sync_failedsync_failedtransient_error · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/transient_errortransient_errorTestDispatchNexusTaskByEndpoint_NamespaceNotFound_Retryable · introduced test · go.temporal.io/server/service/frontend/TestDispatchNexusTaskByEndpoint_NamespaceNotFound_RetryableTestDispatchNexusTaskByE…TestDispatchNexusTaskByEndpoint_NotFound_NonRetryable · introduced test · go.temporal.io/server/service/frontend/TestDispatchNexusTaskByEndpoint_NotFound_NonRetryableTestDispatchNexusTaskByE…TestDispatchNexusTaskByEndpoint_NotFound_Retryable · introduced test · go.temporal.io/server/service/frontend/TestDispatchNexusTaskByEndpoint_NotFound_RetryableTestDispatchNexusTaskByE…Focused concept · server.go ×4 · 19 introduced LOCserver.go ×4

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: 19 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/nexus/nexusrpc/server.go 19 introduced LOC · 4 ranges

Open complete file

93 // status code based on the type of error.
94 // nolint:revive // Keeping all of the logic together for readability, even if it means the function is long.
95 > func (h *BaseHTTPHandler) WriteFailure(writer http.ResponseWriter, r *http.Request, err error) { server.go
96 > var failure nexus.Failure
97 > var failureError *nexus.FailureError
98 > var opError *nexus.OperationError
99 > var handlerError *nexus.HandlerError
100 > var operationState nexus.OperationState
101 > statusCode := http.StatusInternalServerError
102 >
103 > if errors.As(err, &opError) {
104 operationState = opError.State
105 var convErr error
170 }
171
172 > b, err := json.Marshal(failure) server.go
173 > if err != nil {
174 h.Logger.Error("failed to marshal failure", "error", err)
175 writer.WriteHeader(http.StatusInternalServerError)
176 return
177 }
178 > writer.Header().Set("Content-Type", contentTypeJSON) server.go
179 >
180 > // Set the retry header here after ensuring that we don't fail with internal error due to failed marshaling to
181 > // preserve the user's intent.
182 > if handlerError != nil {
183 switch handlerError.RetryBehavior {
184 case nexus.HandlerErrorRetryBehaviorNonRetryable:
191 }
192
193 > writer.WriteHeader(statusCode) server.go
194 >
195 > if _, err := writer.Write(b); err != nil {
196 h.Logger.Error("failed to write response body", "error", err)
197 }