workflow_handler.go ×9

Frontier kind: Joint frontier

unlabeled · c_dc45440829ce

3 tests · 3891 LOC · 199 files · introduces 2 tests · 44 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges44 lines · 3 files
Tests
2 tests

Contains — complete concept membership

All code (extent)
581 ranges3891 lines · 199 files · Browse complete extent
All tests (intent)
3 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.

2 tests introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

3 files ranked by introduced lines: 44 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/frontend/workflow_handler.go 27 introduced LOC · 9 ranges

Open complete file

6384 }
6385
6386 > func (wh *WorkflowHandler) RespondNexusTaskFailed(ctx context.Context, request *workflowservice.RespondNexusTaskFailedRequest) (_ *workflowservice.RespondNexusTaskFailedResponse, retError error) { workflow_handler.go
6387 > defer log.CapturePanic(wh.logger, &retError)
6388 >
6389 > if request == nil {
6390 return nil, errRequestNotSet
6391 }
6395 // There's no need to validate that the namespace in the token and the request match,
6396 // NamespaceValidatorInterceptor does this for us.
6397 > tt, err := wh.tokenSerializer.DeserializeNexusTaskToken(request.GetTaskToken()) workflow_handler.go
6398 > if err != nil {
6399 return nil, errDeserializingToken
6400 }
6401 > if tt.GetTaskQueue() == "" || tt.GetTaskId() == "" { workflow_handler.go
6402 return nil, errInvalidTaskToken
6403 }
6404 > namespaceId := namespace.ID(tt.GetNamespaceId()) workflow_handler.go
6405 >
6406 > if request.Error == nil && request.Failure == nil { // nolint:staticcheck // checking deprecated field for backwards compatibility
6407 return nil, serviceerror.NewInvalidArgument("request must contain error or failure")
6408 }
6409 > if request.GetError() != nil { // nolint:staticcheck // checking deprecated field for backwards compatibility workflow_handler.go
6410 if details := request.GetError().GetFailure().GetDetails(); details != nil && !json.Valid(details) { // nolint:staticcheck // checking deprecated field for backwards compatibility
6411 return nil, serviceerror.NewInvalidArgument("failure details must be JSON serializable")
6412 }
6413 }
6414 > if request.GetFailure() != nil && request.GetFailure().GetNexusHandlerFailureInfo() == nil { workflow_handler.go
6415 return nil, serviceerror.NewInvalidArgument("request Failure must contain error or failure with NexusHandlerFailureInfo")
6416 }
6420 // good reason to fail at this point.
6421
6422 > taskQueueKind := tt.GetTaskQueueKind() workflow_handler.go
6423 > if taskQueueKind == enumspb.TASK_QUEUE_KIND_UNSPECIFIED {
6424 taskQueueKind = enumspb.TASK_QUEUE_KIND_NORMAL
6425 }
6426 > matchingRequest := &matchingservice.RespondNexusTaskFailedRequest{ workflow_handler.go
6427 > NamespaceId: namespaceId.String(),
6428 > TaskQueue: &taskqueuepb.TaskQueue{
6429 > Name: tt.GetTaskQueue(),
6430 > Kind: taskQueueKind,
6431 > },
6432 > TaskId: tt.GetTaskId(),
6433 > Request: request,
6434 > }
6435 >
6436 > _, err = wh.matchingClient.RespondNexusTaskFailed(ctx, matchingRequest)
6437 > if err != nil {
6438 return nil, err
6439 }
6440 > return &workflowservice.RespondNexusTaskFailedResponse{}, nil workflow_handler.go
6441 }
6442
go.temporal.io/server/api/matchingservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

704
705 // RespondNexusTaskFailed mocks base method.
706 > func (m *MockMatchingServiceClient) RespondNexusTaskFailed(ctx context.Context, in *matchingservice.RespondNexusTaskFailedRequest, opts ...grpc.CallOption) (*matchingservice.RespondNexusTaskFailedResponse, error) { service_grpc.pb.mock.go
707 > m.ctrl.T.Helper()
708 > varargs := []any{ctx, in}
709 > for _, a := range opts {
710 varargs = append(varargs, a)
711 }
712 > ret := m.ctrl.Call(m, "RespondNexusTaskFailed", varargs...) service_grpc.pb.mock.go
713 > ret0, _ := ret[0].(*matchingservice.RespondNexusTaskFailedResponse)
714 > ret1, _ := ret[1].(error)
715 > return ret0, ret1
716 }
717
718 // RespondNexusTaskFailed indicates an expected call of RespondNexusTaskFailed.
719 > func (mr *MockMatchingServiceClientMockRecorder) RespondNexusTaskFailed(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
720 > mr.mock.ctrl.T.Helper()
721 > varargs := append([]any{ctx, in}, opts...)
722 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondNexusTaskFailed", reflect.TypeOf((*MockMatchingServiceClient)(nil).RespondNexusTaskFailed), varargs...)
723 > }
724
725 // RespondQueryTaskCompleted mocks base method.
go.temporal.io/server/api/matchingservice/v1/request_response.pb.go 4 introduced LOC · 1 range

Open complete file

4411 }
4412
4413 > func (x *RespondNexusTaskFailedRequest) GetTaskQueue() *v14.TaskQueue { request_response.pb.go
4414 > if x != nil {
4415 > return x.TaskQueue
4416 > }
4417 return nil
4418 }