pri_matcher.go ×6

Frontier kind: Code frontier

unlabeled · c_fb394c690037

142 tests · 3238 LOC · 150 files · introduces 0 tests · 38 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges38 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
509 ranges3238 lines · 150 files · Browse complete extent
All tests (intent)
142 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: 38 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/pri_matcher.go 35 introduced LOC · 6 ranges

Open complete file

537 // On success, the returned task could be a query task or a regular task
538 // Returns errNoTasks when context deadline is exceeded
539 > func (tm *priTaskMatcher) Poll(ctx context.Context, pollMetadata *pollMetadata) (*internalTask, error) { pri_matcher.go
540 > return tm.poll(ctx, pollMetadata, false)
541 > }
542
543 // PollForQuery blocks until a *query* task is found or context deadline is exceeded
599 func (tm *priTaskMatcher) poll(
600 ctx context.Context, pollMetadata *pollMetadata, queryOnly bool,
601 > ) (*internalTask, error) { pri_matcher.go
602 > start := time.Now()
603 > pollWasForwarded := false
604 > var priority int32
605 > pollResult := "failed"
606 >
607 > defer func() {
608 > // TODO(pri): can we consolidate all the metrics code below?
609 > if pollMetadata.forwardedFrom == "" {
610 > // Only recording for original polls (i.e. on child if forwarded)
611 > metrics.PollLatencyPerTaskQueue.With(tm.metricsHandler).Record(
612 > time.Since(start),
613 > metrics.ForwardedTag(pollWasForwarded),
614 > metrics.MatchingTaskPriorityTag(priority),
615 > metrics.PollResultTag(pollResult),
616 > )
617 > }
618 }()
619
620 > poller := &waitingPoller{ pri_matcher.go
621 > startTime: start,
622 > queryOnly: queryOnly,
623 > forwardCtx: ctx,
624 > pollMetadata: pollMetadata,
625 > }
626 >
627 > var res *matchResult
628 > if pollMetadata.conditions.GetNoWait() {
629 res = tm.data.MatchPollerImmediately(poller)
630 > } else { pri_matcher.go
631 > ctxs := []context.Context{ctx, tm.tqCtx}
632 > res = tm.data.EnqueuePollerAndWait(ctxs, poller)
633 > }
634
635 > if res == nil { pri_matcher.go
636 pollResult = "timeout"
637 return nil, errNoTasks // only possible for MatchPollerImmediately
638 > } else if res.ctxErr != nil { pri_matcher.go
639 if res.ctxErrIdx == 0 {
640 metrics.PollTimeoutPerTaskQueueCounter.With(tm.metricsHandler).Record(1)
go.temporal.io/server/api/matchingservice/v1/request_response.pb.go 3 introduced LOC · 2 ranges

Open complete file