workflow_handler.go ×6

Frontier kind: Code frontier

unlabeled · c_da997e3ce443

16 tests · 3272 LOC · 170 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
447 ranges3272 lines · 170 files · Browse complete extent
All tests (intent)
16 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: 23 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/frontend/workflow_handler.go 23 introduced LOC · 6 ranges

Open complete file

2995 }
2996
2997 > func (wh *WorkflowHandler) ShutdownWorker(ctx context.Context, request *workflowservice.ShutdownWorkerRequest) (_ *workflowservice.ShutdownWorkerResponse, retError error) { workflow_handler.go
2998 > defer log.CapturePanic(wh.logger, &retError)
2999 >
3000 > if request == nil {
3001 return nil, errRequestNotSet
3002 }
3003
3004 > namespaceID, err := wh.namespaceRegistry.GetNamespaceID(namespace.Name(request.GetNamespace())) workflow_handler.go
3005 > if err != nil {
3006 return nil, err
3007 }
3008
3009 // Run all shutdown operations concurrently to minimize latency.
3010 > var waitGroup sync.WaitGroup workflow_handler.go
3011 >
3012 > // Cancel outstanding polls (best-effort)
3013 > if wh.config.EnableCancelWorkerPollsOnShutdown(request.GetNamespace()) {
3014 waitGroup.Go(func() {
3015 if wh.config.EnableMatchingFanOutForPollCancellation(request.GetNamespace()) {
3022
3023 // Record final heartbeat (best-effort)
3024 > if request.WorkerHeartbeat != nil && wh.config.WorkerHeartbeatsEnabled(request.GetNamespace()) { workflow_handler.go
3025 waitGroup.Go(func() {
3026 _, err := wh.matchingClient.RecordWorkerHeartbeat(ctx, &matchingservice.RecordWorkerHeartbeatRequest{
3042 // Unload sticky task queue (required - error fails shutdown)
3043 // TODO: update poller info to indicate poller was shut down (pass identity/reason along)
3044 > _, unloadError := wh.matchingClient.ForceUnloadTaskQueuePartition(ctx, &matchingservice.ForceUnloadTaskQueuePartitionRequest{ workflow_handler.go
3045 > NamespaceId: namespaceID.String(),
3046 > TaskQueuePartition: &taskqueuespb.TaskQueuePartition{
3047 > TaskQueue: request.GetStickyTaskQueue(),
3048 > TaskQueueType: enumspb.TASK_QUEUE_TYPE_WORKFLOW, // sticky task queues are always workflow queues
3049 > },
3050 > })
3051 >
3052 > waitGroup.Wait()
3053 >
3054 > if unloadError != nil {
3055 return nil, unloadError
3056 }
3057
3058 > return &workflowservice.ShutdownWorkerResponse{}, nil workflow_handler.go
3059 }
3060