activity.go ×6

Frontier kind: Joint frontier

unlabeled · c_22f89205674e

2 tests · 2637 LOC · 129 files · introduces 2 tests · 35 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges35 lines · 3 files
Tests
2 tests

Contains — complete concept membership

All code (extent)
430 ranges2637 lines · 129 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.

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

go.temporal.io/server/chasm/lib/activity/activity.go 30 introduced LOC · 6 ranges

Open complete file

155 activitypb.ACTIVITY_EXECUTION_STATUS_RESET_REQUESTED:
156 return true
157 > default: activity.go
158 > return false
159 }
160 }
887 func (a *Activity) handleCancellationRequested(ctx chasm.MutableContext, request *activitypb.RequestCancelActivityExecutionRequest) (
888 *activitypb.RequestCancelActivityExecutionResponse, error,
889 > ) { activity.go
890 > req := request.GetFrontendRequest()
891 > newReqID := req.GetRequestId()
892 > existingReqID := a.GetCancelState().GetRequestId()
893 >
894 > // If already in cancel requested state, fail if request ID is different, else no-op
895 > if a.GetStatus() == activitypb.ACTIVITY_EXECUTION_STATUS_CANCEL_REQUESTED {
896 if existingReqID != newReqID {
897 return nil, serviceerror.NewFailedPrecondition(
902 }
903
904 > hasAttemptInProgress := a.hasAttemptInProgress() activity.go
905 > originalStatus := a.GetStatus()
906 >
907 > // Always transition to CancelRequested
908 > // TODO: this is questionable, since CancelRequested is otherwise a state that implies an attempt
909 > // is in progress.
910 > if err := TransitionCancelRequested.Apply(a, ctx, req); err != nil {
911 return nil, err
912 }
913
914 // Transition to Canceled if no attempt in progress; otherwise wait for worker response.
915 > if !hasAttemptInProgress { activity.go
916 > metricsHandler, err := a.enrichMetricsHandler(ctx, metrics.HistoryRespondActivityTaskCanceledScope)
917 > if err != nil {
918 return nil, err
919 }
920 > err = TransitionCanceled.Apply(a, ctx, cancelEvent{ activity.go
921 > metricsHandler: metricsHandler,
922 > fromStatus: originalStatus,
923 > details: &commonpb.Payloads{
924 > Payloads: []*commonpb.Payload{
925 > payload.EncodeString(req.GetReason()),
926 > },
927 > },
928 > })
929 > if err != nil {
930 return nil, err
931 }
932 }
933
934 > return &activitypb.RequestCancelActivityExecutionResponse{}, nil activity.go
935 }
936
go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1/request_response.pb.go 4 introduced LOC · 1 range

Open complete file

445 }
446
447 > func (x *RequestCancelActivityExecutionRequest) GetFrontendRequest() *v1.RequestCancelActivityExecutionRequest { request_response.pb.go
448 > if x != nil {
449 > return x.FrontendRequest
450 > }
451 return nil
452 }
go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1/activity_state.pb.go 1 introduced LOC · 1 range

Open complete file