matching_engine.go ×6

Frontier kind: Code frontier

unlabeled · c_b3a3bcd3d4aa

15 tests · 3072 LOC · 145 files · introduces 0 tests · 71 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges71 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
474 ranges3072 lines · 145 files · Browse complete extent
All tests (intent)
15 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.

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

go.temporal.io/server/service/matching/matching_engine.go 51 introduced LOC · 6 ranges

Open complete file

3374 historyResponse *historyservice.RecordActivityTaskStartedResponse,
3375 metricsHandler metrics.Handler,
3376 > ) *matchingservice.PollActivityTaskQueueResponse { matching_engine.go
3377 > scheduledEvent := historyResponse.ScheduledEvent
3378 > if scheduledEvent.GetActivityTaskScheduledEventAttributes() == nil {
3379 panic("GetActivityTaskScheduledEventAttributes is not set")
3380 }
3381 > attributes := scheduledEvent.GetActivityTaskScheduledEventAttributes() matching_engine.go
3382 > if attributes.ActivityId == "" {
3383 panic("ActivityTaskScheduledEventAttributes.ActivityID is not set")
3384 }
3385 > if task.responseC == nil { matching_engine.go
3386 ct := timestamp.TimeValue(task.event.Data.CreateTime)
3387 metrics.AsyncMatchLatencyPerTaskQueue.With(metricsHandler).Record(time.Since(ct))
3388 }
3389
3390 > componentRef := task.event.GetData().GetComponentRef() matching_engine.go
3391 > activityAttemptStamp := int32(0)
3392 > if len(componentRef) > 0 {
3393 activityAttemptStamp = task.event.Data.GetStamp()
3394 }
3395
3396 > taskToken := tasktoken.NewActivityTaskToken( matching_engine.go
3397 > task.event.Data.GetNamespaceId(),
3398 > task.event.Data.GetWorkflowId(),
3399 > task.event.Data.GetRunId(),
3400 > task.event.Data.GetScheduledEventId(),
3401 > attributes.GetActivityId(),
3402 > attributes.GetActivityType().GetName(),
3403 > historyResponse.GetAttempt(),
3404 > historyResponse.GetClock(),
3405 > historyResponse.GetVersion(),
3406 > historyResponse.GetStartVersion(),
3407 > componentRef,
3408 > activityAttemptStamp,
3409 > )
3410 > serializedToken, _ := e.tokenSerializer.Serialize(taskToken)
3411 >
3412 > // This is here to ensure that this field is never nil as expected by the TS SDK.
3413 > // This may happen if ScheduleActivityExecution was recorded in version 1.23.
3414 > scheduleToCloseTimeout := attributes.ScheduleToCloseTimeout
3415 > if scheduleToCloseTimeout == nil {
3416 scheduleToCloseTimeout = timestamp.DurationPtr(0)
3417 }
3418
3419 > return &matchingservice.PollActivityTaskQueueResponse{ matching_engine.go
3420 > ActivityId: attributes.ActivityId,
3421 > ActivityType: attributes.ActivityType,
3422 > ActivityRunId: historyResponse.GetActivityRunId(),
3423 > Header: attributes.Header,
3424 > Input: attributes.Input,
3425 > WorkflowExecution: task.workflowExecution(),
3426 > CurrentAttemptScheduledTime: historyResponse.CurrentAttemptScheduledTime,
3427 > ScheduledTime: scheduledEvent.EventTime,
3428 > ScheduleToCloseTimeout: scheduleToCloseTimeout,
3429 > StartedTime: historyResponse.StartedTime,
3430 > StartToCloseTimeout: attributes.StartToCloseTimeout,
3431 > HeartbeatTimeout: attributes.HeartbeatTimeout,
3432 > TaskToken: serializedToken,
3433 > Attempt: taskToken.Attempt,
3434 > HeartbeatDetails: historyResponse.HeartbeatDetails,
3435 > WorkflowType: historyResponse.WorkflowType,
3436 > WorkflowNamespace: historyResponse.WorkflowNamespace,
3437 > PollerScalingDecision: task.pollerScalingDecision,
3438 > Priority: historyResponse.Priority,
3439 > RetryPolicy: historyResponse.RetryPolicy,
3440 > }
3441 }
3442
go.temporal.io/server/api/historyservice/v1/request_response.pb.go 20 introduced LOC · 5 ranges

Open complete file

1954 }
1955
1956 > func (x *RecordActivityTaskStartedResponse) GetAttempt() int32 { request_response.pb.go
1957 > if x != nil {
1958 > return x.Attempt
1959 > }
1960 return 0
1961 }
1989 }
1990
1991 > func (x *RecordActivityTaskStartedResponse) GetClock() *v18.VectorClock { request_response.pb.go
1992 > if x != nil {
1993 > return x.Clock
1994 > }
1995 return nil
1996 }
1997
1998 > func (x *RecordActivityTaskStartedResponse) GetVersion() int64 { request_response.pb.go
1999 > if x != nil {
2000 > return x.Version
2001 > }
2002 return 0
2003 }
2017 }
2018
2019 > func (x *RecordActivityTaskStartedResponse) GetStartVersion() int64 { request_response.pb.go
2020 > if x != nil {
2021 > return x.StartVersion
2022 > }
2023 return 0
2024 }
2025
2026 > func (x *RecordActivityTaskStartedResponse) GetActivityRunId() string { request_response.pb.go
2027 > if x != nil {
2028 > return x.ActivityRunId
2029 > }
2030 return ""
2031 }