workflow.go ×5

Frontier kind: Joint frontier

unlabeled · c_51adbe42e266

2 tests · 2944 LOC · 136 files · introduces 1 test · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges19 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
456 ranges2944 lines · 136 files · Browse complete extent
All tests (intent)
2 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.

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

go.temporal.io/server/service/worker/workerdeployment/workflow.go 19 introduced LOC · 5 ranges

Open complete file

465 // Only valid if deployment is deleted or the request ID matches the current one.
466 if d.State.GetCreateRequestId() == args.GetRequestId() {
467 > return nil workflow.go
468 > }
469
470 return temporal.NewNonRetryableApplicationError(errDeploymentAlreadyExists, errDeploymentAlreadyExists, nil)
471 }
472
473 > func (d *WorkflowRunner) handleCreateWorkerDeployment(ctx workflow.Context, args *deploymentspb.CreateWorkerDeploymentArgs) (*deploymentspb.CreateWorkerDeploymentResponse, error) { workflow.go
474 > // use lock to enforce only one update at a time
475 > err := d.lock.Lock(ctx)
476 > if err != nil {
477 d.logger.Error("Could not acquire workflow lock")
478 return nil, serviceerror.NewDeadlineExceeded("Could not acquire workflow lock")
479 }
480 > defer func() { workflow.go
481 > // Even if the update doesn't change the state we mark it as dirty because of created history events.
482 > d.setStateChanged()
483 > d.lock.Unlock()
484 > }()
485
486 // Re-validate after acquiring lock
487 > err = d.validateCreateWorkerDeployment(args) workflow.go
488 > if err != nil {
489 return nil, err
490 }
491
492 > if d.State.GetCreateRequestId() == args.GetRequestId() { workflow.go
493 > // Duplicate request, return success without writing anything.
494 > return &deploymentspb.CreateWorkerDeploymentResponse{
495 > ConflictToken: d.State.ConflictToken,
496 > }, nil
497 > }
498
499 // At this point this a brand-new workflow.