workflow_handler.go ×11

Frontier kind: Joint frontier

unlabeled · c_456953b31f0d

1 test · 3963 LOC · 200 files · introduces 1 test · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges28 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
609 ranges3963 lines · 200 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

go.temporal.io/server/service/frontend/workflow_handler.go 28 introduced LOC · 11 ranges

Open complete file

6213 }
6214
6215 > func (wh *WorkflowHandler) PollNexusTaskQueue(ctx context.Context, request *workflowservice.PollNexusTaskQueueRequest) (_ *workflowservice.PollNexusTaskQueueResponse, retError error) { workflow_handler.go
6216 > defer log.CapturePanic(wh.logger, &retError)
6217 >
6218 > callTime := time.Now().UTC()
6219 >
6220 > if request == nil {
6221 return nil, errRequestNotSet
6222 }
6223
6224 > wh.logger.Debug("Received PollNexusTaskQueue") workflow_handler.go
6225 > if err := common.ValidateLongPollContextTimeout(ctx, "PollNexusTaskQueue", wh.throttledLogger); err != nil {
6226 return nil, err
6227 }
6228
6229 > namespaceName := namespace.Name(request.GetNamespace()) workflow_handler.go
6230 >
6231 > if err := tqid.NormalizeAndValidate(request.TaskQueue, "", wh.config.MaxIDLengthLimit()); err != nil {
6232 return nil, err
6233 }
6234
6235 > namespaceID, err := wh.namespaceRegistry.GetNamespaceID(namespaceName) workflow_handler.go
6236 > if err != nil {
6237 return nil, err
6238 }
6239
6240 > if len(request.GetIdentity()) > wh.config.MaxIDLengthLimit() { workflow_handler.go
6241 return nil, errIdentityTooLong
6242 }
6243
6244 // route heartbeat to the matching service
6245 > if len(request.WorkerHeartbeat) > 0 && wh.config.WorkerHeartbeatsEnabled(request.GetNamespace()) { workflow_handler.go
6246 workerHeartbeat := request.WorkerHeartbeat
6247 request.WorkerHeartbeat = nil // Clear the field to avoid sending it to matching service.
6265
6266 //nolint:staticcheck // SA1019: worker versioning v0.31
6267 > if err := wh.validateVersioningInfo(request.Namespace, request.WorkerVersionCapabilities, request.DeploymentOptions, request.TaskQueue); err != nil { workflow_handler.go
6268 return nil, err
6269 }
6270
6271 > if contextNearDeadline(ctx, longPollTailRoom) { workflow_handler.go
6272 return &workflowservice.PollNexusTaskQueueResponse{}, nil
6273 }
6274
6275 > pollerID := uuid.NewString() workflow_handler.go
6276 > childCtx := wh.registerOutstandingPollContext(ctx, pollerID, namespaceID.String())
6277 > defer wh.unregisterOutstandingPollContext(pollerID, namespaceID.String())
6278 > matchingResponse, err := wh.matchingClient.PollNexusTaskQueue(childCtx, &matchingservice.PollNexusTaskQueueRequest{
6279 > NamespaceId: namespaceID.String(),
6280 > PollerId: pollerID,
6281 > Request: request,
6282 > })
6283 > if err != nil {
6284 contextWasCanceled := wh.cancelOutstandingPoll(childCtx, namespaceID, enumspb.TASK_QUEUE_TYPE_NEXUS, request.TaskQueue, pollerID)
6285 if contextWasCanceled {
6311 // matchingResponse.GetResponse() can be nil, but gRPC handlers must not return a nil
6312 // response, so return an empty one instead.
6313 > if resp := matchingResponse.GetResponse(); resp != nil { workflow_handler.go
6314 return resp, nil
6315 }
6316 > return &workflowservice.PollNexusTaskQueueResponse{}, nil workflow_handler.go
6317 }
6318