pri_matcher.go ×4

Frontier kind: Code frontier

unlabeled · c_ec5395e69de4

8 tests · 5293 LOC · 192 files · introduces 0 tests · 23 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges23 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1041 ranges5293 lines · 192 files · Browse complete extent
All tests (intent)
8 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: 23 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/pri_matcher.go 18 introduced LOC · 4 ranges

Open complete file

449
450 if returnNoPollerErr {
451 > if deadline, ok := ctx.Deadline(); ok && tm.fwdr == nil { pri_matcher.go
452 > // Reserving 1sec to customize the timeout error if user is querying a workflow
453 > // without having started the workers.
454 > noPollerDeadline := deadline.Add(-returnEmptyTaskTimeBudget)
455 > noPollerCtx, cancel := context.WithDeadline(context.Background(), noPollerDeadline)
456 > defer cancel()
457 > ctxs = append(ctxs, noPollerCtx)
458 > }
459 }
460
465 if res.ctxErr != nil {
466 if res.ctxErrIdx == 2 {
467 > // Index 2 is the noPollerCtx. Only error if there has not been a recent poller. pri_matcher.go
468 > // Otherwise, let it wait for the remaining time hopping for a match, or ultimately
469 > // returning the default CDE error.
470 > if tm.data.TimeSinceLastPoll() > tm.config.QueryPollerUnavailableWindow() {
471 > return nil, errNoRecentPoller
472 > }
473 ctxs = ctxs[:2] // remove noPollerCtx otherwise we'll fail immediately again
474 goto again
492 // Local match is always attempted before forwarding is attempted. If local match occurs
493 // response and error are both nil, if forwarding occurs then response or error is returned.
494 > func (tm *priTaskMatcher) OfferQuery(ctx context.Context, task *internalTask) (*matchingservice.QueryWorkflowResponse, error) { pri_matcher.go
495 > res, err := tm.syncOfferTask(ctx, task, true)
496 > if res != nil { // note res may be non-nil "any" containing nil pointer
497 return res.(*matchingservice.QueryWorkflowResponse), err // nolint:revive
498 }
499 > return nil, err pri_matcher.go
500 }
501
go.temporal.io/server/service/matching/matcher_data.go 5 introduced LOC · 1 range

Open complete file

592 }
593
594 > func (d *matcherData) TimeSinceLastPoll() time.Duration { matcher_data.go
595 > d.lock.Lock()
596 > defer d.lock.Unlock()
597 > return time.Since(d.lastPoller)
598 > }
599
600 // HasWaitingPoller returns if there's a normal (non forwarder)